I made up an idea to make a clip darker at night and a little brighter on full Sun. Now I use Microsoft Math and some page to create functions returning Intensivity of Brightnes in range from -.25 to .75 depending on current hour.
Here is some of my code:
const LUM_R:Number=0.212671,LUM_G:Number=0.715160,LUM_B:Number=0.072169;
var strength:Number=getStrength(),invert:Number=1 - strength,r:Number=0x00,g:Number=0x00,b:Number=0x00;
content.filters=[new ColorMatrixFilter([invert + strength * r * LUM_R, strength * r * LUM_G, strength * r * LUM_B, 0, 0, strength * g * LUM_R, invert + strength * g * LUM_G, strength * g * LUM_B, 0, 0, strength * b * LUM_R, strength * b * LUM_G, invert + strength * b * LUM_B, 0, 0, 0, 0, 0, 1, 0])];
}
private function getStrength():Number {
var date=new Date();
switch(date.getMonth()) {
case 0:
case 11:
return -3259 / 49008960 * Math.pow(date.getHours(),4) + 24223/8168160 * Math.pow(date.getHours(),3) - 1612211 / 49008960 * Math.pow(date.getHours(),2) + 1283 / 2042040 * date.getHours() + .75;
case 1:
return -779 / 32947200 * Math.pow(date.getHours(),4) + 10753 / 10982400 * Math.pow(date.getHours(),3) - 5771 / 1267200 * Math.pow(date.getHours(),2) - 87733 / 686400 * date.getHours() + .75;
case 2:
return 683 / 232792560 * Math.pow(date.getHours(),4) - 31153 / 116396280 * Math.pow(date.getHours(),3) + 3152267 / 232792560 * Math.pow(date.getHours(),2) - 2052331 / 9699690 * date.getHours() + .75;
case 3:
case 7:
return 13 / 670320 * Math.pow(date.getHours(),4) - 13 / 13965 * Math.pow(date.getHours(),3) + 2803 / 134064 * Math.pow(date.getHours(),2) - 6527 / 27930 * date.getHours() + .75;
case 4:
return 2209 / 77261600 * Math.pow(date.getHours(),4) - 44579 / 30904640 * Math.pow(date.getHours(),3) + 4650131 / 154523200 * Math.pow(date.getHours(),2) - 5536257 / 19315400 * date.getHours() + .75;
case 5:
case 6:
return 7 / 184320 * Math.pow(date.getHours(),4) - 7 / 3840 * Math.pow(date.getHours(),3) + 79 / 2304 * Math.pow(date.getHours(),2) - 143 / 480 * date.getHours() + .75;
case 8:
return 1457 / 132935400 * Math.pow(date.getHours(),4) - 17377 / 29541200 * Math.pow(date.getHours(),3) + 4533383 / 265870800 * Math.pow(date.getHours(),2) - 491683 / 2215590 * date.getHours() + .75;
case 9:
return -6563/596118600 * Math.pow(date.getHours(),4) + 182449 / 397412400 * Math.pow(date.getHours(),3) + 1782271 / 1192237200 * Math.pow(date.getHours(),2) - 7358023 / 49676550 * date.getHours() + .75;
case 10:
return -73 / 1837080 * Math.pow(date.getHours(),4) + 667 / 408240 * Math.pow(date.getHours(),3) - 1637 / 136080 * Math.pow(date.getHours(),2) - 1753 / 17010 * date.getHours() + .75;
}
}
I’d like ur comments and some other ideas of doing that
(maybe someone would know how include weather :P)