From 6cc8add1d63ad07caf0a267905fc52d1badb2129 Mon Sep 17 00:00:00 2001 From: Maddie Lord Date: Thu, 12 Jun 2025 13:01:34 -0700 Subject: [PATCH] Remove global assignment in color.js These lines cause the common ART error: Cannot react property "hex" of undefined (https://github.com/reactjs/react-art/issues/116). They do not have any functionality-- the global variable that it attempts to set is never read. --- core/color.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/core/color.js b/core/color.js index 71f74bf..833301d 100644 --- a/core/color.js +++ b/core/color.js @@ -193,29 +193,21 @@ Color.hex = function(hex){ return new Color(hex, 'hex'); }; -if (this.hex == null) this.hex = Color.hex; - Color.hsb = function(h, s, b, a){ return new Color([h || 0, s || 0, b || 0, (a == null) ? 1 : a], 'hsb'); }; -if (this.hsb == null) this.hsb = Color.hsb; - Color.hsl = function(h, s, l, a){ return new Color([h || 0, s || 0, l || 0, (a == null) ? 1 : a], 'hsl'); }; -if (this.hsl == null) this.hsl = Color.hsl; - Color.rgb = function(r, g, b, a){ return new Color([r || 0, g || 0, b || 0, (a == null) ? 1 : a], 'rgb'); }; -if (this.rgb == null) this.rgb = Color.rgb; - Color.detach = function(color){ color = new Color(color); return [Color.rgb(color.red, color.green, color.blue).toString(), color.alpha]; }; -module.exports = Color; \ No newline at end of file +module.exports = Color;