X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=js%2Fuserdesign.go.js;h=eb4dece095efe77b302e8d61c4db3ac60f81c5dd;hb=956b3ef4d18c091cb070708fd941df27b5c0264d;hp=4416dc8aeef39ffe56473a6185b244f24a5eb187;hpb=d0a020dd4ea8d58bc8230ebcde22e54ad31894a8;p=quix0rs-gnu-social.git diff --git a/js/userdesign.go.js b/js/userdesign.go.js index 4416dc8aee..eb4dece095 100644 --- a/js/userdesign.go.js +++ b/js/userdesign.go.js @@ -1,10 +1,10 @@ /** Init for Farbtastic library and page setup * - * @package Laconica - * @author Sarven Capadisli - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Sarven Capadisli + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ $(document).ready(function() { function InitColors(i, E) { @@ -27,14 +27,15 @@ $(document).ready(function() { } } - /* rgb2hex written by R0bb13 */ function rgb2hex(rgb) { + if (rgb.slice(0,1) == '#') { return rgb; } rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); - function hex(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]; - } - return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]); + return '#' + dec2hex(rgb[1]) + dec2hex(rgb[2]) + dec2hex(rgb[3]); + } + /* dec2hex written by R0bb13 */ + 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]; } function UpdateColors(S) {