So, I know I can set a pixel’s color with a HEX value, leds[i] = 0xRRGGBB;, but how would I implement that for fill_solid? For example, I have an array of specific colors (in HEX): colors[] = {0x112233, 0x445566, 0x778899}; And what I’d like to do is use fill_solid to fill parts of the string with one of those colors. Something like,
fill_solid(&(leds[0]), 12, CRGB(pick-random-color));
Or should I have the array filled with different datatypes that CRGB (or CHSV) can read in easily?
Make your colors array uint32_t - then you should be able to do
fill_solid(leds, 12, colors[random(3)]);
(assuming there’s 3 colors in your color array). C++ type conversion should convert to CRGB for you. That’s how things like CRGB::Black works - CRGB::Black is just an enum value set to 0x000000
Here’s something I’ve never done before: posted code partially written by the kid. I contributed the ARRAY_LENGTH macro, and gave (lots of) C++ syntax help. The color choices are hers.
Yep, that’s actually where the actual code is going to. I just needed the bare bones method … I like starting on the ground level and build from there.