Hello to the community!
I am wondering if there is a way to get the LEDs current color.
Before calling FastLED.show(); we are storing everything in the leds array but if you query this array it doesn’t give you the HSV values but 1 or 0.
The only solution I see today is to build a whole new array to store the values and be able to get the current color. Am I missing something?
Thanks!
?? wouldn’t you get RGB values not HSV?
If it’s a CRGB array, just grab the array index you are interested in, and check the .r, .g, and .b values. You shouldn’t need a second array because the first array tells you what you want to know. If you want to get the closest representation of the HSV color, use hsv2rgb_rainbow() and query the CRGB color as I indicated above.
I don’t know if there is a == operator on CRGB to compare it to a color either, but I’m not sure how easy to use that would be.
@Peter_Buelow nice thanks! can you do the same with CHSV array though? From my experience it didn’t work but I might get it wrong.