Well, I was trying to make the background slowly shift hue, but like I said the "FadeThrough" method wasn't what I thought. So, I wrote this little piece of code.
It works. However, I'm using a gray-scale image and this results in some moments where the gray will come through. 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.
I'll put the code for the HSL at the end of the post
after the RGB example.
Thanks for any help in advance.RGB Color Shiftingvar 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);
}
Here's the HSL attemptvar 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);
}