Hi, could somebody please tell me what the correct way of adding a Html

Hi, could somebody please tell me what the correct way of adding a Html v2 colour is please instead of red, to my piece of code here:

void loop() {
for(int dot = 0; dot < NUM_LEDS; dot++) {
leds[dot] = CRGB::Red;
FastLED.show();
// clear this led for the next time around the loop
leds[dot] = CRGB::Black;
delay(30);
}

regards
Stuart

Hi - could you give an example of what you are trying to do?

You can also change “CRGB::Red” to “CRGB( r, g, b)” for any r g and b values.

Hi Mark,

The little bit of code I posted has a moving dot of red, but I want to be able to put a HTML colour in like: .setRGB( 255, 68, 221);

however when I put that in the code it does not compile.

Thanks
Stuart

Try either

leds[i] = CRGB( 255, 68, 221);

or

leds[i].setRGB(255, 68, 221);

Hi Mark,
I got the top version to compile, and works a treat,
Thanks
Stuart