summaryrefslogtreecommitdiff
path: root/js/userdesign.go.js
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-08-26 21:56:59 -0400
committerCraig Andrews <candrews@integralblue.com>2009-08-26 21:56:59 -0400
commit3e362233ee2f7acd676c0ee86025d7511f265b7e (patch)
treef691c476d17d31517e3367c1bc3d9608c4d7eed8 /js/userdesign.go.js
parent504c42aa7d4ff5cccd722bceb3231a5a8f46a27b (diff)
parentb7beac36c2dbebfa27982b2fc6c82cf2ebbaae8d (diff)
Merge commit 'laconica/0.8.x' into 0.9.x
Diffstat (limited to 'js/userdesign.go.js')
-rw-r--r--js/userdesign.go.js3
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];