Don't understand the code for common anode Rgb led

Hey, I'm totally new to arduino.
I was doing the rgb led stuff following a tutorial. It worked, but I don't understand why I need these:

red = 255 - red;
green = 255 - green;
blue = 255 - blue;

The entire code is here:

Thanks!

Does it mean that I can say
red = 0;
green = 0;
blue = 0;

?

Or I even don't need to write code about their values?

Those lines only get executed if you uncomment the #define COMMON_ANODE. Without those lines, the code is designed to drive a common cathode RGB LED, where the common connection is grounded and the voltage from the output pins increases for greater brightness. With a common anode LED, the common connection goes to +5 volts, and the voltage on the output pins needs to decrease to increase the brightness. Since 255 is maximum output voltage, those lines of code are effectively inverting the amount of voltage you are outputting, so as the number goes up, the voltage decreases, and makes the common anode LED brighter.

Here is the entire code:

/*
Adafruit Arduino - Lesson 3. RGB LED
*/

int redPin = 11;
int greenPin = 10;
int bluePin = 9;

//uncomment this line if using a Common Anode LED
//#define COMMON_ANODE

void setup()
{
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);  
}

void loop()
{
  setColor(255, 0, 0);  // red
  delay(1000);
  setColor(0, 255, 0);  // green
  delay(1000);
  setColor(0, 0, 255);  // blue
  delay(1000);
  setColor(255, 255, 0);  // yellow
  delay(1000);  
  setColor(80, 0, 80);  // purple
  delay(1000);
  setColor(0, 255, 255);  // aqua
  delay(1000);
}

void setColor(int red, int green, int blue)
{
  #ifdef COMMON_ANODE
    red = 255 - red;
    green = 255 - green;
    blue = 255 - blue;
  #endif
  analogWrite(redPin, red);
  analogWrite(greenPin, green);
  analogWrite(bluePin, blue);  
}

Thank you!