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.
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.