There is no "law" or "regulation", at least in the U.S. I've VIP'd and O2 cleaned many cylinders that just have the standard black knob on them. I don't require any of my customers to change to a green knob just because they're O2 cleaning a cylinder for oxygen use.
Do whatever you want. The techie divers reserve green for oxygen on their deco bottles a lot of the time, but that's a techie diver "recommendation" not a statute.
I got reamed by a fellow techie diver one time when I joked that I was going to put green knobs on my cylinders. He went off ranting about "green means oxygen", and "I was gonna get somebody kilt by doing that" etc etc. My response was the common industry standard, "Then keep your paws off my cylinders and the color of my cylinder knobs won't affect you. Why would you just grab my cylinder and use it without me telling you to?"
My thinking is, they are MY cylinders, so I should be the only one using them, and I know whats in them. If I "loan" you one, and I do do that sometimes, then I'll tell you whats inside.
If another diver is dumb enough to just grab any random tank and use it without analyzing it, then I'm OK with Darwin "thinning the herd" like that so to speak.
I've never seen anyone grab a scuba cylinder in a injured diver scenario just because it has a green knob on it thinking it was 100% O2. We have special dedicated bottles for that with oxygen specific valves on them.
I also use the yellow tape that has a place to write date/mix/MOD on them, and I stick them on the crown of all my cylinders when they
are analyzed, so the obvious label should supersede any "color designation" scheme in my simple way of thinking.