The orange color was probably iron oxide (rust) and the green color was probably copper oxide. (released oxygen reacting with the wire and some steel touching the water?)
Electrolysis is well-known and widely experimented with. I was on a submaring from 1977-81, and we used this process to make oxygen, which was stored in a stand-by tank to be bled into the breathing air.
Putting electricity into water separates the hydrogen and oxygen into gasses. Single atoms are unstable and most pair-up to achieve a higher state of stability (H2/O2)
Gasoline is very dense (C8-H18) and has a lot more power than H2, which is MUCH less dense. A piston engine can be converted to run on H2, but much of the energy is wasted as heat in the exhaust.
There are also losses when using generator output to make the H2, some of the generator energy is also wasted as the generator gets hot.
The submarine had extra electrical energy to spare, and we wanted the O2 at any cost, but to burn H2 in a generator to make H2, you would be spending a dollar to get a nickel.