And also because the HSV to RGB conversion will attempt to (roughly) provide a non-linear curve to brightness, whereas the %= is just a straight scale8 of the rgb values. (Well, technically, scale8 video, but for the purposes here, they’re effectively the same thing).
Here’s what I got. I came up with this RGB clock. It’s level is controlled by a LDR. It’s analog reading is mapped three times: first 50-200 being the hands(red green, blue), second 50-100 all “remaining” led’s and last 200-0 being an inverted saturation for the same “remaining” led’s. So, during the day the saturation for the remaining 57 led’s is close to zero: they go white. During the night their saturation fades to value 200 and turn blue AND dim as well. Needing to be able so set a saturation level, I have to use the CHSV object. There is no “set.Sat” like there is “set.Hue”.
If setHue controls brightness, what controls hue? This doesn’t make sense to me.
In the above code , hue stays the same throughout and the led’s behave accordingly. It’s the dimming (if I change the values simultaneously) that doesn’t run smooth. Is there a way to control both hue AND saturation in a mathematical way so I can assign a value to both separately? setHue and % do it in a nice way, but setHSV not.
I can use HSV but it doesn’t give the same output as setHue and % combined.
When using HSV, the level “kicks in” at level 16, whereas % does a better job starting at 2 (out of 255). I just made a video showing the difference. Let me see if I can upload it
Okay, I’ll give it a try. BUT this still leaves me with the saturation part. How do I control the sat for a given led while NOT using the setHSV command? I can set the level (%=) for a specific led, I can set the hue (setHue) but not it’s saturation. How so set the saturation for any given led using a single value?
@Roger_M Glad I could help! Did you use dim8_raw as well?
Daniel, Mark I’m checking the hsv2rgb code. Is the non-lineair scaling only implemented in the default hsv2rgb_rainbow? Because I can’t find it in the hsv2rgb_raw (that was the one I was using and which had some strange behavior after applying a dim_curve to the rgb values).