Merge branch 'i382' of https://github.com/kberg/dygraphs into i382
[dygraphs.git] / rgbcolor / rgbcolor.js
index b8b29d7..5a88244 100644 (file)
@@ -2,13 +2,20 @@
  * 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.
+ *
+ * Modifications by adilh:
+ * Original "RGBColor" function name collides with:
+ *   http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-RGBColor
+ * so renamed to "RGBColorParser"
  *
  * @author Stoyan Stefanov <sstoo@gmail.com>
  * @link   http://www.phpied.com/rgb-color-parser-in-javascript/
  * @license Use it if you like it
  */
-function RGBColor(color_string)
+"use strict";
+
+function RGBColorParser(color_string)
 {
     this.ok = false;
 
@@ -217,7 +224,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];