How to declare intervals Fastled

Hello, I would like to smarter option to declare the color ranges that I have in the code.
That is compartments
FROM
0-15
16-31
32-46
47-67
without listing them all.

Later, I would like to make the leds in this color dim, as for the fade effect. I have no programming experience I am a handyman and I need this for a lamp.
Thank you for your help and best regards.

#include "FastLED.h"
#define NUM_LEDS 4
CRGB leds[NUM_LEDS];
#define PIN 7

void setup()
{
  FastLED.addLeds<WS2811, PIN, GRB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );

}

// *** REPLACE FROM HERE ***
void loop() {
  
      
      leds[0] = CRGB::Green; 
      leds[1] = CRGB::Green; 
      leds[2] = CRGB::Green; 
      leds[3] = CRGB::Green; 
      leds[4] = CRGB::Green; 
      leds[5] = CRGB::Green; 
      leds[6] = CRGB::Green;
      leds[7] = CRGB::Green; 
      leds[8] = CRGB::Green; 
      leds[9] = CRGB::Green; 
      leds[10] = CRGB::Green; 
      leds[11] = CRGB::Green; 
      leds[12] = CRGB::Green; 
      leds[13] = CRGB::Green; 
      leds[14] = CRGB::Green; 
      leds[15] = CRGB::Green; 

      leds[16] = CRGB::Red;
      leds[17] = CRGB::Red; 
      leds[18] = CRGB::Red; 
      leds[19] = CRGB::Red; 
      leds[20] = CRGB::Red;
      leds[21] = CRGB::Red;
      leds[22] = CRGB::Red; 
      leds[23] = CRGB::Red; 
      leds[24] = CRGB::Red; 
      leds[25] = CRGB::Red;
      leds[26] = CRGB::Red; 
      leds[27] = CRGB::Red;
      leds[28] = CRGB::Red;
      leds[29] = CRGB::Red; 
      leds[30] = CRGB::Red; 
      leds[31] = CRGB::Red; 

      leds[32] = CRGB::Blue; 
      leds[33] = CRGB::Blue;
      leds[34] = CRGB::Blue; 
      leds[35] = CRGB::Blue;
      leds[36] = CRGB::Blue; 
      leds[37] = CRGB::Blue;
      leds[38] = CRGB::Blue; 
      leds[39] = CRGB::Blue;
      leds[40] = CRGB::Blue; 
      leds[41] = CRGB::Blue;
      leds[42] = CRGB::Blue; 
      leds[43] = CRGB::Blue;
      leds[44] = CRGB::Blue; 
      leds[45] = CRGB::Blue;

      leds[46] = CRGB::HotPink; 
      leds[47] = CRGB::HotPink;
      leds[48] = CRGB::HotPink; 
      leds[49] = CRGB::HotPink;
      leds[50] = CRGB::HotPink; 
      leds[51] = CRGB::HotPink;
      leds[52] = CRGB::HotPink; 
      leds[53] = CRGB::HotPink;
      leds[54] = CRGB::HotPink; 
      leds[55] = CRGB::HotPink;
      leds[56] = CRGB::HotPink; 
      leds[57] = CRGB::HotPink;
      leds[58] = CRGB::HotPink; 
      leds[59] = CRGB::HotPink;
      leds[60] = CRGB::HotPink; 
      leds[61] = CRGB::HotPink;
      leds[62] = CRGB::HotPink; 
      leds[63] = CRGB::HotPink;
      leds[64] = CRGB::HotPink; 
      leds[65] = CRGB::HotPink;
      leds[66] = CRGB::HotPink;
      leds[67] = CRGB::HotPink;
  
      FastLED.show();
      delay(0);
      
 
    }



void showStrip() {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.show();
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   FastLED.show();
 #endif
}

void setPixel(int Pixel, byte red, byte green, byte blue) {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.setPixelColor(Pixel, strip.Color(red, green, blue));
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   leds[Pixel].r = red;
   leds[Pixel].g = green;
   leds[Pixel].b = blue;
 #endif
}

void setAll(byte red, byte green, byte blue) {
  for(int i = 0; i < NUM_LEDS; i++ ) {
    setPixel(i, red, green, blue);
  }
  showStrip();
}
stuff( CRGB::Green,    0, 16 );
stuff( CRGB::Red,     16, 32 );
stuff( CRGB::Blue,    32, 46 );
stuff( CRGB::HotPink, 46, 68 );


void stuff( COLOR, START, END ) P
    for( ndx = START; ndx < END; ndx++ )
        leds[ndx] = COLOR;
}

Thanks for the answer. After adding the code, I get this error.

exit status 1
'stuff' was not declared in this scope

change

void stuff( COLOR, START, END ) P
}

to

void stuff( COLOR, START, END ) {
}

Thanks for the answer. I still have a error.

WS281x_Strip:20:27: error: ‘END’ was not declared in this scope

WS281x_Strip:20:34: error: expected unqualified-id before ‘{’ token

exit status 1
‘stuff’ was not declared in this scope

I add ;

void stuff( COLOR, START, END ); {
}

#include "FastLED.h"
#define NUM_LEDS 4
CRGB leds[NUM_LEDS];
#define PIN 7

void setup()
{
  FastLED.addLeds<WS2811, PIN, GRB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );

}

void loop() 

stuff( CRGB::Green,    0, 16 );
stuff( CRGB::Red,     16, 32 );
stuff( CRGB::Blue,    32, 46 );
stuff( CRGB::HotPink, 46, 68 );


void stuff( COLOR, START, END ); {
 

    for( ndx = START; ndx < END; ndx++ )
        leds[ndx] = COLOR;
}

void showStrip() {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.show();
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   FastLED.show();
 #endif
}

void setPixel(int Pixel, byte red, byte green, byte blue) {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.setPixelColor(Pixel, strip.Color(red, green, blue));
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   leds[Pixel].r = red;
   leds[Pixel].g = green;
   leds[Pixel].b = blue;
 #endif
}

void setAll(byte red, byte green, byte blue) {
  for(int i = 0; i < NUM_LEDS; i++ ) {
    setPixel(i, red, green, blue);
  }
  showStrip();
}

You are trying to declare the function stuff inside the loop function. The C language does not allow you to do this.

Move the stuff declaration to after the loop function declaration.

I have the same issue

#include "FastLED.h"
#define NUM_LEDS 4
CRGB leds[NUM_LEDS];
#define PIN 7

void setup()
{
  FastLED.addLeds<WS2811, PIN, GRB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );

}


stuff( CRGB::Green,    0, 16 );
stuff( CRGB::Red,     16, 32 );
stuff( CRGB::Blue,    32, 46 );
stuff( CRGB::HotPink, 46, 68 );

void loop() {
  
  void stuff( COLOR, START, END ); {
 

    for( ndx = START; ndx < END; ndx++ )
        leds[ndx] = COLOR;
}
  
      FastLED.show();
      delay(0);
      
 
    }



void showStrip() {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.show();
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   FastLED.show();
 #endif
}

void setPixel(int Pixel, byte red, byte green, byte blue) {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.setPixelColor(Pixel, strip.Color(red, green, blue));
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   leds[Pixel].r = red;
   leds[Pixel].g = green;
   leds[Pixel].b = blue;
 #endif
}

void setAll(byte red, byte green, byte blue) {
  for(int i = 0; i < NUM_LEDS; i++ ) {
    setPixel(i, red, green, blue);
  }
  showStrip();
}

I have the same issue

That is because you made the same mistake.

A function declaration, in this case, starts with the word void. You have not moved the declaration you have moved the function calls.
https://www.arduino.cc/en/Reference/FunctionDeclaration

cold or hot?
I understand that in this forum I do not write programs for someone but I am 55 years old and I do not understand programming. I have a lamp and I would like it to shine. If anyone can write it to me. Thank you

#include "FastLED.h"
#define NUM_LEDS 4
CRGB leds[NUM_LEDS];
#define PIN 7

void setup()
{
  FastLED.addLeds<WS2811, PIN, GRB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );

}

void stuff( COLOR, START, END ); 

void loop() {

stuff( CRGB::Green,    0, 16 );
stuff( CRGB::Red,     16, 32 );
stuff( CRGB::Blue,    32, 46 );
stuff( CRGB::HotPink, 46, 68 );


        for( ndx = START; ndx < END; ndx++ )
        leds[ndx] = COLOR;


      FastLED.show();
      delay(0);
      
 
    }



void showStrip() {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.show();
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   FastLED.show();
 #endif
}

void setPixel(int Pixel, byte red, byte green, byte blue) {
 #ifdef ADAFRUIT_NEOPIXEL_H
   // NeoPixel
   strip.setPixelColor(Pixel, strip.Color(red, green, blue));
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H
   // FastLED
   leds[Pixel].r = red;
   leds[Pixel].g = green;
   leds[Pixel].b = blue;
 #endif
}

void setAll(byte red, byte green, byte blue) {
  for(int i = 0; i < NUM_LEDS; i++ ) {
    setPixel(i, red, green, blue);
  }
  showStrip();
}[b][/b]

Very cold.
Use 8 leds and this code to demonstrate the stuff function, but renamed fillRange which is more like what it does.
The loop function just calls this function four times and displays.

#include "FastLED.h"
#define NUM_LEDS 8
CRGB leds[NUM_LEDS];
#define PIN 7

void setup()
{
  FastLED.addLeds<WS2811, PIN, GRB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
  // FastLED.addLeds<NEOPIXEL, PIN>(leds, NUM_LEDS);
}

// Lets give this a more meaningful name than stuff
// this is the start of a function definition
void fillRange( CRGB COLOR, int START, int END ){ 
        for(int ndx = START; ndx < END; ndx++ )
        leds[ndx] = COLOR;
} // this is the end of a function definition

void loop() {
int del = 600; // change this to make it run faster
fillRange( CRGB::Green,    0, 2 ); 
FastLED.show();
delay(del);
fillRange( CRGB::Red,     2, 4 );
FastLED.show();
delay(del);
fillRange( CRGB::Blue,    4, 6 );
FastLED.show();
delay(del);
fillRange( CRGB::HotPink, 6, 8 );
FastLED.show();
delay(del);
setAll(0, 0, 0); // turn it all off 
delay(del); 
}

void setPixel(int Pixel, byte red, byte green, byte blue) {
   // FastLED
   leds[Pixel].r = red;
   leds[Pixel].g = green;
   leds[Pixel].b = blue;
}

void setAll(byte red, byte green, byte blue) {
  for(int i = 0; i < NUM_LEDS; i++ ) {
    setPixel(i, red, green, blue);
  }
  FastLED.show();
}

I kindly thank you from your help. I'll be home tonight and I will test it.