Working on my first Arduino project using NeoPixels. I'm fairly familiar with programming (PHP, JS, node) but C is new to me and stuck at this point.
Basic gist is creating themes (palettes of colours) that can be selected by the user.
I have the colours defined as an INT array with RGB values e.g.
INT red[3] = {255,0,0}; // r, g, b
INT blue[3] = {0,0,255}
etc.
These are then stored in themes e.g.
char* rainbow[] = {"red", "orange", "yellow" ... };
Later, I call these in a loop:
rainbow[1] returns string "orange" etc as expected. All this section works.
However, I need to then pass the color name onto a function:
void colorStrip(int color[3]) { ... // do some colour stuff
The function is expecting an array such a one of the colors defined above e.g. colorStrip( red )...and this works fine.
However, I want to be able to use the string returned from rainbow[1] e.g
colorStrip( rainbow[1] );
What's the best way to accomplish this?