Setting colors calculates red and green values correctly