diff options
author | Benjamin Jones <bjones@galois.com> | 2013-01-02 13:15:11 -0800 |
---|---|---|
committer | Benjamin Jones <bjones@galois.com> | 2013-01-02 13:15:11 -0800 |
commit | 2152b111db76392c08d8d406ae32cc3ae54b8b11 (patch) | |
tree | 5d26e1d0d4e12467176c088214f3944d60097c3a /contexts/data/fiveui/injected/prelude.js | |
parent | 56fabf776a9f64807e675204e03b1795015cdca5 (diff) | |
parent | 5130943d66def581a8d6a084a2b5ffa2c3a1c8b1 (diff) |
Merge branch 'master' of src.galois.com:/srv/git/FiveUI
Diffstat (limited to 'contexts/data/fiveui/injected/prelude.js')
-rw-r--r-- | contexts/data/fiveui/injected/prelude.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/contexts/data/fiveui/injected/prelude.js b/contexts/data/fiveui/injected/prelude.js index 825f769..abe249e 100644 --- a/contexts/data/fiveui/injected/prelude.js +++ b/contexts/data/fiveui/injected/prelude.js @@ -256,6 +256,9 @@ fiveui.color.colorCheck = function (selector, colorSet) { * Covert rgb colors to hex and abreviated hex colors to their full 3 byte * form. * + * In case there are parse errors during the conversion, i.e. color values + * that are not understood, the input is returned unchanged. + * * @param {!String} color The color string to convert. This should be either of the form rgb(...) or #... * @returns {!String} The color string in #XXXXXX form * @throws {ParseError} if the rgb color string cannot be parsed @@ -279,10 +282,8 @@ fiveui.color.colorToHex = function(color) { var digits = /rgba?\((\d+), (\d+), (\d+)/.exec(color); if (!digits) { - throw { - 'name': 'ParseError', - 'message': 'Could not parse rgb color: ' + color - }; + return color; // in case there is a parse error, we just + // return the input unchanged } var red = parseInt(digits[1]); |