var r = 0;
var g = 0;
var b = 0;
var myent = this.GetNode("background");
var timer = 0;
var lr = 255;
var lg = 0;
var lb = 0;
var done = true;
////////////////////////////////////////////////////////////////////////////////
method SetColor(ent,red,green,blue,alpha)
{
ent.AlphaColor = RGB(red,green,blue,alpha);
}
while(true)
{
if(done == true)
{
// Set the next color
r = Random(0,255);
g = Random(0,255);
b = Random(0,255);
done = false;
Game.Msg("New Color - r:"+r+" - g:"+g+" - b:"+b+"");
Game.LOG("New Color - r:"+r+" - g:"+g+" - b:"+b+"");
}
if(lr != r && lg != g && lb != b)
{
if(lr < r)
lr = lr + 1;
else if(lr > r)
lr = lr - 1;
if(lg < g)
lg = lg + 1;
else if(lg > g)
lg = lg - 1;
if(lb < b)
lb = lb + 1;
else if(lb > b)
lb = lb - 1;
}
else
{
done = true;
}
SetColor(myent,lr,lg,lb,255);
Game.Msg("Current Color - r:"+lr+" - g:"+lg+" - b:"+lb+"");
Sleep(100);
}
var hue = 0;
var myent = this.GetNode("background");
var color = 255;
while(true)
{
hue = hue + 1;
if(hue > 255)
hue = 0;
color = MakeHSL(hue,255,255);
// myent.AlphaColor = RGB(GetRValue(color),GetGValue(color),GetBValue(color),255);
myent.AlphaColor = color;
Game.Msg("Hue "+hue+" Background Color - r:"+GetRValue(myent.AlphaColor)+" - g:"+GetGValue(myent.AlphaColor)+" - b:"+GetBValue(myent.AlphaColor)+"");
Game.Msg("Attempted Color - H:"+GetHValue(color)+" - S:"+GetSValue(color)+" - L:"+GetLValue(color)+"");
Game.Msg(""+color+"");
Sleep(100);
}
I've tried the new HSL and it seems to make the following: h = 0, s = 0, l = 255. Which gives no colorization at all. ::slugYes, that's how the HSL color model works. Luminance of 255 is white, luminance of 0 is black. You can experiment with HSL using a color picker in some drawing program. Perhaps you want to be changing the luminance component, not hue? I'm still not sure what effect you're after.