Hi I'm very new to Arduino and coding in general and I'm having some

Hi

I’m very new to Arduino and coding in general and I’m having some problems understanding how color works with LEDs.

When I assign an LED in my array to CRGB (255,0,0) it displays red perfectly. However I’m trying to have an LED fade in from black to pink. The color I want is (255,75,165) which is a bright pink. When I display that color on my strip, it is basically white with a slight pink hue… Not at all what I was expecting. I also tried a loop which cycled through 5 times and did the following:

FastLED.setBrightness(brightness); // already at 10
leds[I] += CRGB(51,15,33);
FastLED.show();
brightness = brightness + 10;
delay(300)

My thought was that this would bring the LEDs up to the pink I wanted after the 5th time through the loop. What actually happens is that they immediately are the pink I want and proceed to become much to bright white with a faint hint of pink with each cycle through the loop. Is there something I’m doing wrong?

I’m using fastled 2.1 on an Arduino Uno. I also just noticed that I have a ws21812b strip and have them set to ws21811 in my initial setup. Could that be my problem? I’d really appreciate any help.

I’d try using HSV values instead.
See this page https://github.com/FastLED/FastLED/wiki/Pixel-reference#chsv

Your pink colour is approximately 35,75,100 from here http://www.rapidtables.com/convert/color/rgb-to-hsv.htm

leds[i] = CHSV( 35, 75, 100);

The last number is the Value or brightness

So you can go through the loop and increase the Value instead of setting the overall brightness.

It’s also probably a good plan to update your FastLED library.

Thank you both for the help. I’m finding that the LEDs are just brighter than what you get on an RGB color picker online. My main goal is to make a sunrise alarm clock light and was trying to do a color math to blend from pink to blue. I just read about fill gradients and it’s a hell of a lot easier than the loops I was coming up with.

I also double checked and I do have 3.1 installed

Again, thank you both for the help!

Another thing to have in mind when it comes to leds and colors not being displayed as you would like to see them is that leds have a very linear color representation whereas eyes have a non linear perception.
There is a good article from adafruit explaining it:

and of course there is a fix in fastled (i think the hsv does it)
And you can always add some color correction: