I was making up a list of the FastLED commands for my own use

I was making up a list of the FastLED commands for my own use and ran across this one:

//Fill a string with one color
fill_solid( &(leds[i]), 1 /number of leds/, CRGB( 255, 68, 221) )

To use it in a sketch with a HCSV colors I would have to call hsv2rgb first and then use the result to pass to the fill_solid?

Is there a better way to lite all the LEDs with one CHSV color? That isn’t hard but fill_rainbow uses CHSV colors so i was wondering…

If you are using a sketch that is based on Hue,Saturation,Value(HSV), then you really wouldn’t want to use the fill_solid function. I prefer to use this:

uint8_t hue = 0; // color range 0 - 255
leds[i] = setHue(hue);

Using the Rainbow conversion, its less bulky looking and easier to read/interpret later as you expand your code.

hmmm, I’m not sure I understand why that would be better. It works but has drawbacks.

Say I want to set 60 LEDs on a strip to the same Hue, a light blue with medium intensity. In CHSV(160, 150, 175).

I’m wishing here but I think I would rather set all of them to one HSV value at once with something like fill_solid but using HSV parameters…

I can set all 60 LEDs to rainbow colors with one command, fill_rainbow, why not a single hue? Yea, it’s the easy button…

With your method would I have to:

uint8_t hue = 0; // color range 0 - 255
for (i = 0; i < ledCount, i++) {
leds[i] = setHue(hue);
}

very doable but it would only give me a fully saturated, fully lit LED Strip of that hue (using setHue, right?

Please Sir, may I have more? Users are such a pain in the %&* aren’t they? :slight_smile:

Ok, I see…easy fix.

int ledCount = 60;

for (int i = 0; i < ledCount, i++) {
leds[i] = CHSV(160, 150, 175);
}

The “for” loop populates the CRGB array (which is your storage facility for your entire length of LEDs) with the assigned color of 160 hue, 150 saturation, 175 value in the CHSV() function. From what I understand, you may want to wait for a higher level programmer to chime in, but I think you still have to use a for statement on the fill_solid function?