give a class's function name as a parameter I'm trying code using FastLed library to have a 3 state ( color or brightness ) led strip, using a physical input switch, while each press will change leds color, using a predefined list.

code below demonstrate  1) create a colorPallete of two colors 2) try to use it in loop with no success.

#include &lt;FastLED.h&gt;

// How many leds in your strip?
#define NUM_LEDS 1

// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN.  For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 3
//#define CLOCK_PIN 13

// Define the array of leds
CRGB leds[NUM_LEDS];
int colorSelctor = 0;
int birughtSelector = 25;
int inputPin = 13;
char *colorPallete[2] = {"Red","Blue"};

void setup() {
  // FastLED.addLeds&lt;WS2812, DATA_PIN, RGB&gt;(leds, NUM_LEDS);
  // FastLED.addLeds&lt;WS2812B, DATA_PIN, RGB&gt;(leds, NUM_LEDS);
  FastLED.addLeds&lt;NEOPIXEL, DATA_PIN&gt;(leds, NUM_LEDS);
  pinMode(inputPin, INPUT_PULLUP);
}

void loop() {
  // Turn the LED on, then pause
  leds[0] = CRGB::colorPallete[0];
  FastLED.show();
  delay(500);
  // Now turn the LED off, then pause
  leds[0] = CRGB::Black;
  FastLED.show();
  delay(500);
}
CRGB::Red, etc, are just numbers. You need to treat them as such.

uint32_t colorPallette[2] = { CRGB::Red, CRGB::Blue };


And then:

leds[0] = colorPallete[0];


From pixeltypes.h:

/// Predefined RGB colors
typedef enum {
    AliceBlue=0xF0F8FF,
    Amethyst=0x9966CC,
    AntiqueWhite=0xFAEBD7,
    Aqua=0x00FFFF,
    Aquamarine=0x7FFFD4,
    Azure=0xF0FFFF,
    Beige=0xF5F5DC,
    Bisque=0xFFE4C4,
    Black=0x000000,
      ... etc ...
} HTMLColorCode;