From a69c929602e64f10fb3903b89a2ca9e9ed2c8dfb Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 22 Feb 2012 10:33:25 -0800 Subject: Fixing eyedropper tool to get color from image data. This required us to workaround having inconsistent color object. Signed-off-by: Nivesh Rajbhandari --- js/controllers/color-controller.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'js/controllers/color-controller.js') diff --git a/js/controllers/color-controller.js b/js/controllers/color-controller.js index e3b15f1c..a6e41dd3 100755 --- a/js/controllers/color-controller.js +++ b/js/controllers/color-controller.js @@ -322,7 +322,19 @@ exports.ColorController = Montage.create(Component, { //Simple solid color color = this.parseCssToColor(css); } - //Returning color object (or null if none) + // TODO - Hack for inconsistent color object -- some workflows set color.color and some color.value + if(color) + { + if(color.value && !color.color) + { + color.color = color.value; + } + else if(color.color && !color.value) + { + color.value = color.color; + } + } + //Returning color object (or null if none) return color; } }, -- cgit v1.2.3