Color fader for Anode RGB led

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?

What else do I have to change?

The important question is what happens if you write values from 255 to 0, decreasing by one each iteration, to ONE pin at a time, in a for loop. Does the appropriate portion of the LED change color correctly?

cagancelik:
I replaced zeros with 255 but couldn't get what I want. What else do I have to change?

Well, you'd also have to replace 255's with zeroes. And fix any value in between. The easiest way is usually to change

  analogWrite(pin, pwmValue);

to

  analogWrite(pin, 255-pwmValue);