Converts a 32 bit color value into hue, saturation, and lightness values as known in painting programs.
The HSL value is returned as int and can be processed using
GetRGBaValue or
SplitRGBaValue.
All values range from 0 to 255.
Since there is no floating point data type in Clonk, these values may contain slight rounding errors (usually not greater than +1 to +1).
#strict
#appendto CLNK
func Initialize() {
AddEffect("VariateHue",this(),200,1,this());
return(_inherited());
}
func FxVariateHueTimer() {
var rgb, hsl=RGB2HSL(GetColorDw());
var hue, sat, light;
SplitRGBaValue(hsl, hue, sat, light);
hue+=2;
if(hue>255) hue=0;
rgb=HSL2RGB(RGB(hue,sat,light));
SetColorDw(rgb);
}
Creates an effect which will colorize every clonk in the game, running through the colors of the rainbow.