fill_gradient (leds, 42, CHSV(0,255,255), 99, CHSV(96,255,255), SHORTEST_HUES);
42 = the starting pixel.
CHSV(0,255,255) = the gradient start color.
99 = the ending pixel.
CHSV(96,255,255) = the gradient end color.
SHORTEST_HUES = The hue is a value on a color wheel. There are always two directions you can go to get from one place on a wheel to another (one hue value to another hue value). FastLED lets you pick the direction you want to go. SHORTEST_HUES is the shortest distance between the two values (the most common choice), LONGEST_HUES is the longest way around. FORWARD_HUES always moves clockwise. BACKWARD_HUES always moves counter-clockwise.
In the above example, pixels 42-99 will start as red at 42 and transition to green by 99.
Experiment with making the start and end pixel position variables!
Note, instead of HSV you can also use RGB format if you prefer:
fill_gradient_RGB (leds, 42, CRGB(255,0,0), 99, CRGB(0,255,0) );
----------------------------------
Another idea is to create a temporary working array such as:
CRGB leds_temp[NUM_LEDS];
Operate on the temp array as normal:
fill_gradient (leds_temp, CHSV(0,255,255), CHSV(96,255,255) )
and then before calling FastLED.show() shift everything over by a certain amount:
// Copy leds_temp to leds while shifting everything over.
uint8_t shiftBy = 30;
for(int i = 0; i < NUM_LEDS; i++) {
leds[(i + shiftBy) % NUM_LEDS] = leds_temp[i];
}