Quote:
Originally Posted by Gunderak
@ffcmike
Your method seems a tad better, but I really don't know how you drew yourself to make the arrays. Wouldn't that of taken a very long time?
|
PHP Code:
//#CLIENTSIDE
function onCreated(){
for(temp.i = 0; temp.i < 101; temp.i ++){
temp.c = this.getAlignmentColor(temp.i);
temp.a.add("{" @ temp.c @ "},");
temp.s.add("{" @ this.getAlignmentShadow(temp.i, temp.c) @ "},");
}
temp.a.savelines("apvalues.txt", 0);
temp.s.savelines("shadowvalues.txt", 0);
function getAlignmentColor(value) {
if (value<=0) return {64,0,0};
if (value<=26) return {128+int(127*(value-1)/25),64-int(64*(value-1)/25),64-int(64*(value-1)/25)};
if (value<=49) return {255,int(255*(value-26)/24),int(255*(value-26)/24)};
if (value<=55) return {255,255,255};
if (value<=60) return {255-int(127*(value-55)/5),255,255-int(127*(value-55)/5)};
if (value<=70) return {128-int(128*(value-61)/10),255,128+int(127*(value-61)/10)};
if (value<=99) return {0,255-int(255*(value-70)/29),255};
return {231,199,0};
}
function getAlignmentShadow(temp.ap, temp.c) {
if (temp.ap == 100)
temp.c = {255,255,0};
else
temp.c[0] = temp.c[1] = 255 * !(temp.c[0]>191.25 || temp.c[1]>191.25);
return temp.c;
}