X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=rgbcolor%2Frgbcolor.js;h=67b730e59975ee3c08563c0c61c232e4b6d02b25;hb=5469113bc1d7bb38c9214e709c87598b7f6ef256;hp=b8b29d75cbf2e22a0ef5176725b6511b362cb983;hpb=a232a35c1f2a8c7f02d0e31f39745e7748c5227a;p=dygraphs.git diff --git a/rgbcolor/rgbcolor.js b/rgbcolor/rgbcolor.js index b8b29d7..67b730e 100644 --- a/rgbcolor/rgbcolor.js +++ b/rgbcolor/rgbcolor.js @@ -2,12 +2,14 @@ * A class to parse color values * * NOTE: modified by danvk. I removed the "getHelpXML" function to reduce the - * file size. + * file size, added "use strict" and a few "var" declarations where needed. * * @author Stoyan Stefanov * @link http://www.phpied.com/rgb-color-parser-in-javascript/ * @license Use it if you like it */ +"use strict"; + function RGBColor(color_string) { this.ok = false; @@ -217,7 +219,7 @@ function RGBColor(color_string) var processor = color_defs[i].process; var bits = re.exec(color_string); if (bits) { - channels = processor(bits); + var channels = processor(bits); this.r = channels[0]; this.g = channels[1]; this.b = channels[2];