blog games developers documentation portfolio gallery

Documentation:

Hue()

void Hue(float deltaHue)



Will convert all pixels from RGB to their HSB values, change the H (Hue) and convert them back to RGB.

deltaHue can be any value between -1.0 and +1.0. When deltaHue = 0.0, nothing is changed.
When deltaHue = -1.0 or +1.0 nothing will change either because you shift all colors along a full color circle.
A delta hue - -0.5 will have the same effect as a deltaHue of +0.5, since the colors are shifted over a half color circle in opposite directions and will end at the same color.

Example:

if(GUI.Button(new Rect(0,0,200,25), "Freaky colors")) {
myTexture.Hue(0.5f); // shift hue by 0.5 (= half color circle)
}








follow us