mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-28 06:35:26 +00:00
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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user