diff options
author | Zach Copley <zach@controlyourself.ca> | 2009-08-25 20:46:14 -0700 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2009-08-25 20:46:14 -0700 |
commit | 2f1e719cbee6734053c70845665204ee1899c88e (patch) | |
tree | f2d67f3d3bd98143e5b551cd7c24a725ab28f71c | |
parent | 0e3598cea950b7503b351af8fb4c59d6b029a16c (diff) | |
parent | 70ef9d89fab6daaf0cf2169007475e92859d05c4 (diff) |
Merge branch '0.8.x' of git@gitorious.org:laconica/mainline into 0.8.x
* '0.8.x' of git@gitorious.org:laconica/mainline:
Updated rgb2hex() to handle IE. It turns out that jQuery is giving hex
-rw-r--r-- | js/userdesign.go.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/js/userdesign.go.js b/js/userdesign.go.js index c53569bea..8ddb9ec38 100644 --- a/js/userdesign.go.js +++ b/js/userdesign.go.js @@ -27,11 +27,12 @@ $(document).ready(function() { } } - /* rgb2hex written by R0bb13 <robertorebollo@gmail.com> */ function rgb2hex(rgb) { + if (rgb.slice(0,1) == '#') { return rgb; } rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); return '#' + dec2hex(rgb[1]) + dec2hex(rgb[2]) + dec2hex(rgb[3]); } + /* dec2hex written by R0bb13 <robertorebollo@gmail.com> */ function dec2hex(x) { hexDigits = new Array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); return isNaN(x) ? '00' : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16]; |