user-1: My scheme is very basic: I use RGB LED with Arduino Uno. 5v is connected to anode, and pins 9-11 are connected to cathodes. 
When using following sketch, my LED is producing white colour, which red, green and blue components are on:
int redPin = 9;
int greenPin = 10;
int bluePin = 11;

void setup(){}

void loop(){
  analogWrite(redPin, 0);
  analogWrite(greenPin, 0);
  analogWrite(bluePin, 0);
}

But when I refer to docs for PWM:
A call to analogWrite() is on a scale of 0 - 255, such that analogWrite(255) requests a 100% duty cycle (always on)

When I write 0 to all pins, I expect led to be off. What am I missing?

user-1: Your LEDs are connected to the supply voltage. The output must be low to allow the LED to shine.
Output 0 ==> LED on

user368: Since you've connected to the cathodes the pins are sinking current. As such the LEDS are active low with 0 being almost fully on and 255 being fully off.

user4143: With your LEDs connected to +5V (AKA "Common Anode"), the PWM signal is reversed.

When the output is "on", the voltage on the pin is 5v.
When the output is "off", the voltage on the pin is 0V.

The difference in voltage between +5V and the pin for those two different states is:

"On" = 5V - 5V = 0V
"Off" = 5V - 0V = 5V

So you can see than when the output is off the LED will on because it causes a difference in voltage from one side of the LED to the other, so current can flow.  When the output is on the voltages either side of the LED are the same, so no current will flow.

-1: <p>My scheme is very basic: I use RGB LED with Arduino Uno. 5v is connected to anode, and pins 9-11 are connected to cathodes. </p>

<p>When using following sketch, my LED is producing white colour, which red, green and blue components are on:</p>

<pre><code>int redPin = 9;
int greenPin = 10;
int bluePin = 11;

void setup(){}

void loop(){
  analogWrite(redPin, 0);
  analogWrite(greenPin, 0);
  analogWrite(bluePin, 0);
}
</code></pre>

<p>But when I refer to <a href="http://arduino.cc/en/Tutorial/PWM" rel="nofollow">docs</a> for PWM:</p>

<pre><code>A call to analogWrite() is on a scale of 0 - 255, such that analogWrite(255) requests a 100% duty cycle (always on)
</code></pre>

<p>When I write <code>0</code> to all pins, I expect led to be off. What am I missing?</p>
 -1: <p>Your LEDs are connected to the supply voltage. The output must be low to allow the LED to shine.</p>

<p><code>Output 0 ==&gt; LED on</code></p>
 368: <p>Since you've connected to the cathodes the pins are <em>sinking</em> current. As such the LEDS are active <em>low</em> with 0 being almost fully on and 255 being fully off.</p>
 4143: <p>With your LEDs connected to +5V (AKA "Common Anode"), the PWM signal is reversed.</p>

<ul>
<li>When the output is "on", the voltage on the pin is 5v.</li>
<li>When the output is "off", the voltage on the pin is 0V.</li>
</ul>

<p>The difference in voltage between +5V and the pin for those two different states is:</p>

<ul>
<li>"On" = 5V - 5V = 0V</li>
<li>"Off" = 5V - 0V = 5V</li>
</ul>

<p>So you can see than when the output is off the LED will on because it causes a difference in voltage from one side of the LED to the other, so current can flow.  When the output is on the voltages either side of the LED are the same, so no current will flow.</p>
