Monotone-Parent: 4da2e2aa68da3f6c69bddae3167041872607c9d2

Monotone-Revision: 589cbe87a5260166298c57c4fa50494edb7b9fbd

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-04-22T17:16:37
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2008-04-22 17:16:37 +00:00
parent 092b303a45
commit 99d4c95556
5 changed files with 74 additions and 33 deletions
+17
View File
@@ -307,6 +307,23 @@ function onAjaxRequestStateChange(http) {
}
}
/* taken from Lightning */
function getContrastingTextColor(bgColor) {
var calcColor = bgColor.substring(1);
var red = parseInt(calcColor.substring(0, 2), 16);
var green = parseInt(calcColor.substring(2, 4), 16);
var blue = parseInt(calcColor.substring(4, 6), 16);
// Calculate the brightness (Y) value using the YUV color system.
var brightness = (0.299 * red) + (0.587 * green) + (0.114 * blue);
// Consider all colors with less than 56% brightness as dark colors and
// use white as the foreground color, otherwise use black.
return ((brightness < 144)
? "white"
: "black");
}
function triggerAjaxRequest(url, callback, userdata, content, headers) {
var http = createHTTPClient();