Monotone-Parent: 85e8a21a77536298272957804613bdc6189853fc

Monotone-Revision: 1166336fab8e7bdf13b850af8c0155fa72c445ff

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-12-20T16:45:52
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2006-12-20 16:45:52 +00:00
parent e66bf60cb7
commit 05c347d281
4 changed files with 76 additions and 38 deletions
+20 -12
View File
@@ -940,24 +940,32 @@ function d2h(d) {
}
function indexColor(number) {
var colorTable = new Array(1, 1, 1);
var color;
var currentValue = number;
var index = 0;
while (currentValue)
{
if (currentValue & 1)
colorTable[index]++;
if (number == 0)
color = "#ccf";
else {
var colorTable = new Array(1, 1, 1);
var currentValue = number;
var index = 0;
while (currentValue)
{
if (currentValue & 1)
colorTable[index]++;
if (index == 3)
index = 0;
currentValue >>= 1;
index++;
}
}
color = ("#"
+ d2h((256 / colorTable[2]) - 1)
+ d2h((256 / colorTable[1]) - 1)
+ d2h((256 / colorTable[0]) - 1));
}
return ("#"
+ d2h((256 / colorTable[2]) - 1)
+ d2h((256 / colorTable[1]) - 1)
+ d2h((256 / colorTable[0]) - 1));
return color;
}
var onLoadHandler = {