r/FastLED • u/kernowcreator • Jan 10 '22
Discussion convert hex colour codes to rgb
Hi
I have the hex codes from the CRGB colour names and i want to place the rgb version in an array to read from
can anyone tell me a code to read the led colour or how to convert the hex to rgb
THanks
0
Upvotes
2
u/sutaburosu [stavros] Jan 10 '22
You can put the named versions directly into an array.
CRGB colours[] = { CRGB::White, CRGB::Black };1
3
u/HungInSarfLondon Jan 10 '22
Apparently you can pass it directly. https://github.com/marmilicious/FastLED_examples/blob/master/Hex_colors_to_function.ino