You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2017/03/05 00:54:09 UTC

[1/2] git commit: [flex-asjs] [refs/heads/develop] - Add parsing support for rgb colours

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 3ed6f9d63 -> 5f43ec5fa


Add parsing support for rgb colours


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

Branch: refs/heads/develop
Commit: 4eaa69ebd202aa932ab3814556cc3d468bc117f5
Parents: 3ed6f9d
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Mar 5 11:51:22 2017 +1100
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Mar 5 11:51:22 2017 +1100

----------------------------------------------------------------------
 .../Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4eaa69eb/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
index ee5fb32..1c0451c 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -604,7 +604,7 @@ package org.apache.flex.core
                     var n:Number = Number(value);
                     if (isNaN(n))
                     {
-                        if (value.charAt(0) == "#")
+                        if (value.charAt(0) == "#" || value.indexOf("rgb") == 0)
                         {                            
                             obj[pieces[0]] = CSSUtils.toColor(value);
                         }


[2/2] git commit: [flex-asjs] [refs/heads/develop] - Alpha should be in range 0 to 1

Posted by jm...@apache.org.
Alpha should be in range 0 to 1


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

Branch: refs/heads/develop
Commit: 5f43ec5fab821fabffcf998cc1d95598f8a236c9
Parents: 4eaa69e
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Mar 5 11:53:49 2017 +1100
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Mar 5 11:53:49 2017 +1100

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/utils/CSSUtils.as | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5f43ec5f/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 72abe6e..2102acd 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
@@ -139,19 +139,21 @@ package org.apache.flex.utils
                 stringValue = stringValue.substring(c + 4, c2);
                 var parts3:Array = stringValue.split(",");
                 return (0xFF000000 + 
-                        uint(parts3[0]) << 16 +
-                        uint(parts3[1]) << 8 +
+                        (uint(parts3[0]) << 16) +
+                        (uint(parts3[1]) << 8) +
                         uint(parts3[2]));
             }
             else if ((c = stringValue.indexOf("rgba(")) != -1)
             {
                 c2 = stringValue.indexOf(")");
-                stringValue = stringValue.substring(c + 4, c2);
+                stringValue = stringValue.substring(c + 5, c2);
                 var parts4:Array = stringValue.split(",");
-                return (uint(parts4[3]) << 24 + 
-                    uint(parts3[0]) << 16 +
-                    uint(parts3[1]) << 8 +
-                    uint(parts3[2]));
+                parts4[3] *= 255; // range is 0 to 1
+
+                return ((uint(parts4[3]) << 24) +
+                        (uint(parts4[0]) << 16) +
+                        (uint(parts4[1]) << 8) +
+                        uint(parts4[2]));
             }
             
             if (colorMap.hasOwnProperty(stringValue))