Light intensity on RGB led

Hi all.

I'm wondering how to control the light intensity on a RGB led without affecting the light color. Another doubt that I have is, why when I pass some RGB values to the led it doesn't display the color that I want? For example if I pass 255, 255, 255, the light turn on like blue, it is weird.

I will appreciate any feedback on this question.

Regards.

If you use digitalWrite() on each LED separately does each colour look right ?

Please post the whole program that you are using to "pass 255, 255, 255"

Basically you're asking how to dim an RGB led from (example) white at full brightness to dim while not changing the tint of the white? That's a million dollar question; it requires careful calibration for the particular RGB LED. To make things worse the LED tint varies with temperature and, in my experience, tends to go more red with age.