nested for loops in fast_leds/ws2812 strips

hi, im trying to get this led strip to fade up and down then switch colors n on n on etc. im trying to program 2 colors at once inside a for loop and its not working.

everything works but the last for loop is screwy when i try to fade a mikx of B and G. (j and z)
void loop() {

for( int j = 0; j < 200; j++) {
for (int i = 0; i < NUM_LEDS; i++) {

//j below increments the blue to high
leds = CRGB(0,0,j);

  • }*
  • FastLED.show();*
  • delay(20);*
  • }*
    for(int j = 200; j > 0; j–) {
  • for (int i = 0; i < NUM_LEDS; i++) {*
    //j below increments the blue to back to off
    _ leds = CRGB(0,0,j);_
    }
    FastLED.show();
    * delay(20);*
    }

for(int j = 0; j < 200; j++) {
* for(int z = 0; z < 200; z++){ //—My line I added to try changing G and B colors at the same time*
//HERES WHERE IT GOES WRONG. IT FLASHES TO GREEN ON HIGH THEN SLOWLY FADES TO
//ITS CORRECT SETTING OF 200 OF BLUE AND 200 GREEN(an icy blue green)
for(int i = 0; i < NUM_LEDS; i++){
_ leds*=CRGB(0,z,j);
}
}
}
FastLED.show();
delay(20);
}*
WHY would it jump directly to pure green then start fading to the mix of 200blue n 200green?
are my for loops set up wrong?_

Instead of using the crgb function, I would use the chsv function....

It's a lot easier to use when changing colors...

https://github.com/FastLED/FastLED/wiki/FastLED-HSV-Colors