It must be somewhere in the docs i'm sure, but i cannot find it...

It must be somewhere in the docs i’m sure, but i cannot find it… I would like to have a rainbow (or any other) effect on a subset of leds in a led strip. How to define this subset?

For fill_rainbow, it’s normally:

fill_rainbow(leds, NUM_LEDS, thishue, deltahue);

Try:

fill_rainbow(leds+6, 3, thishue, deltahue);

This would fill the whole strip with a complete rainbow (starting with hue 77).
fill_rainbow( leds, NUM_LEDS, 77, 255/NUM_LEDS);

And this would fill part of the strip with a complete rainbow (starting with hue 77). The rainbow would start on pixel number 5, and would end 5 pixels from the end.
fill_rainbow( &(leds[4]), NUM_LEDS-8, 77, 255/(NUM_LEDS-10) );

@Remco_Koffijberg - Use CRGBSet to fill a section of a strip with a rainbow or other effects. See:

Also, see my comments in:

https://plus.google.com/107393830490573958525/posts/EeycViNcQaP

Note Be careful that the number of pixels you’re filling does Not go past the number of leds you’ve defined for NUM_LEDS. That will cause memory issues and could lockup your program/MCU.

“Writing data to pixels that don’t exist causes bad things to happen.” (TM Daniel Garcia).

@Ken_White tx!!

@marmil Garcia, a wise man

In my project only some leds of the strip are visible. Is there a way to add individual leds to the CRGB set? (like only led number 5,11,14, 21 etc).

No, CRGBSet needs a consecutive range of pixels.

@marmil Ok thanks. That saves me a lot of time! (-;

@Remco_Koffijberg I forgot to come back to this post and share this… To make a specific group of pixels into a pixel set, or custom CRGB set you can do something like this:

uint8_t LED_lookupTable_length = 5; //number of pixels in set
uint8_t LED_lookupTable[] = { 1, 4, 5, 7, 9}; //specific pixels

Then to run through it, use a for loop and use the values in the table to target the corresponding LEDs:
for( uint8_t LED = 0; LED < LED_lookupTable_length; LED++) {
uint8_t pos = LED_lookupTable[LED];
leds[pos] = CRGB(255, 0, 0); //assign some color
}