Check for illegal color values

Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/24c2fdfa
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/24c2fdfa
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/24c2fdfa

Branch: refs/heads/refactor-sprite
Commit: 24c2fdfa06185a66958014c99723e2891b8359f1
Parents: a44ce43
Author: yishayw <yishayj...@hotmail.com>
Authored: Wed Oct 26 18:50:40 2016 +0300
Committer: yishayw <yishayj...@hotmail.com>
Committed: Wed Oct 26 18:50:40 2016 +0300

----------------------------------------------------------------------
 .../Core/src/main/flex/org/apache/flex/utils/CSSUtils.as         | 4 ++++
 .../src/main/flex/org/apache/flex/graphics/SolidColor.as         | 2 ++
 .../src/main/flex/org/apache/flex/graphics/SolidColorStroke.as   | 3 +++
 3 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/24c2fdfa/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/CSSUtils.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/CSSUtils.as 
b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/CSSUtils.as
index 22c7efa..977fb09 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/CSSUtils.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/CSSUtils.as
@@ -40,6 +40,10 @@ package org.apache.flex.utils
                
         public static function attributeFromColor(value:uint):String
         {
+                       if(value > 16777215)
+                       {
+                               //rgba -- return rgb notation
+                       }
             return "#" + StringPadder.pad(value.toString(16),"0",6);
         }
         /**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/24c2fdfa/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColor.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColor.as
 
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColor.as
index cbf49d4..3318c0e 100644
--- 
a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColor.as
+++ 
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColor.as
@@ -101,6 +101,8 @@ package org.apache.flex.graphics
                
                public function set color(value:uint):void
                {
+                       if(value < 0 || value > 0xffffff)
+                               throw new Error("Color values must be between 0 
and 0xFFFFFF");
                        var oldValue:uint = _color;
                        if (value != oldValue)
                        {

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/24c2fdfa/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
 
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
index dddbea8..be5c766 100644
--- 
a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
+++ 
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
@@ -95,6 +95,9 @@ package org.apache.flex.graphics
         
         public function set color(value:uint):void
         {
+                       if(value < 0 || value > 0xffffff)
+                               throw new Error("Color values must be between 0 
and 0xFFFFFF");
+                       
             var oldValue:uint = _color;
             if (value != oldValue)
             {

Reply via email to