diff options
author | Evan Prodromou <evan@status.net> | 2009-08-27 14:18:51 -0700 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2009-08-27 14:18:51 -0700 |
commit | bbb830e14c718c687f0636710a1827c90b11f4cc (patch) | |
tree | ff637b6b10ecd760c410f8dfea81f2f7113989ab /js/userdesign.go.js | |
parent | 82b0927f5838f3c12816e03712df9460a9f77b72 (diff) | |
parent | 2dd5a5f86d5242362499c381c8d9519f40a8925b (diff) |
Merge branch '0.8.x' of git@gitorious.org:laconica/mainline into 0.8.x
Diffstat (limited to 'js/userdesign.go.js')
-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 18f72f96a..eb4dece09 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]; |