some updates

This commit is contained in:
Harry Bomrah committed 2012-04-18 18:15:02 +08:00
1 parent d14630769a
commit 6b35cf821e
4 files changed
+92 -44

No files matched your search

+8 -1
View File
@@ -55,5 +55,12 @@ var orbitDesktopAPI = function(){
var A = key(a), B = key(b);
return ((A < B) ? -1 : (A > B) ? +1 : 0) * [-1,1][+!!reverse];
}
}
};
this.rgb2hex = function(rgb) {
rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
var hex = function(x) {
return ("0" + parseInt(x).toString(16)).slice(-2);
}
return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
};
};