I tried to use this example on my anode RGB led but it did not reproduce all the colors. Such as no red but pink, no blue but cyan, no green but greenish yellow.
This example is written for cathode RGB leds. Which produces a color if the pin is given voltage, but anode works the other way around. So I did play with this section of the code to fix it:
// Color arrays
int black[3] = { 0, 0, 0 };
int white[3] = { 100, 100, 100 };
int red[3] = { 100, 0, 0 };
int green[3] = { 0, 100, 0 };
int blue[3] = { 0, 0, 100 };
int yellow[3] = { 40, 95, 0 };
int dimWhite[3] = { 30, 30, 30 };
// etc.
I replaced zeros with 255 but couldn't get what I want. What else do I have to change?