X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=rgbcolor%2Frgbcolor.js;h=bcdf94cf5238480237591e373e234e4b4804d3d2;hb=14ea2141f073e01b01708740414a17668a6aef3b;hp=5a882446e6ad3610cd36b75a02ff726afc5b208a;hpb=21ebe38bb1eeae3a7fd73335a411bfd81c66d985;p=dygraphs.git diff --git a/rgbcolor/rgbcolor.js b/rgbcolor/rgbcolor.js index 5a88244..bcdf94c 100644 --- a/rgbcolor/rgbcolor.js +++ b/rgbcolor/rgbcolor.js @@ -9,12 +9,21 @@ * http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-RGBColor * so renamed to "RGBColorParser" * + * Modifications by konigsberg: + * Make Closure-compatible. + * * @author Stoyan Stefanov * @link http://www.phpied.com/rgb-color-parser-in-javascript/ * @license Use it if you like it */ "use strict"; +/** + * Create a new instance. + * + * @param {string} color_string the string to be parsed. + * @constructor + */ function RGBColorParser(color_string) { this.ok = false; @@ -188,9 +197,9 @@ function RGBColorParser(color_string) example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'], process: function (bits){ return [ - parseInt(bits[1]), - parseInt(bits[2]), - parseInt(bits[3]) + parseInt(bits[1], 10), + parseInt(bits[2], 10), + parseInt(bits[3], 10) ]; } },