I'm making something wrong here.

(Juergen Bruegl) #1

I’m making something wrong here. Maybe someone can point me in the right direction:
I have different presets and want to use the color names as variables.
normal usage:
fill_solid(leds, NUM_LEDS, CRGB::Green);

but I want to assign to the variable color1 the string ‘Green’
char color1[] = “Green”;
fill_solid(leds, NUM_LEDS, CRGB::[color1]);

Is this possible? Please help :slight_smile:

(Jeremy Spencer) #2

CRGB color1 = CRGB::Green;
fill_solid(leds, NUM_LEDS, color1);
Does that help?

(Juergen Bruegl) #3

Thanks Jeremy for your quick response but it did not work.
I defined at the bottom of the settings
#define C_Beauty
#ifdef C_Beauty
CRGB color1 = CRGB::Pink;
CRGB color2 = CRGB::Lavender;
CRGB color3 = CRGB::DeepPink;
CRGB color4 = CRGB::MediumPurple;

and get here
fill_solid(leds, NUM_LEDS, CRGB::color1);

the error message
‘color1’ is not a member of ‘CRGB’

(Jeremy Spencer) #4

like this

fill_solid(leds, NUM_LEDS, color1);

(Juergen Bruegl) #5

@Jeremy_Spencer @Chris_Parton Amazing !! Thank you so much!