You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2015/07/15 02:55:00 UTC
[2/5] git commit: [flex-falcon] [refs/heads/develop] - handle #fff.
3-digits after the hash get each digit duplicated!
handle #fff. 3-digits after the hash get each digit duplicated!
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/35ba1129
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/35ba1129
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/35ba1129
Branch: refs/heads/develop
Commit: 35ba11290aa8e0315affb68b9935c79e4aa93d38
Parents: dc60ca0
Author: Alex Harui <ah...@apache.org>
Authored: Tue Jul 14 08:25:39 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Jul 14 17:54:54 2015 -0700
----------------------------------------------------------------------
.../compiler/internal/css/CSSColorPropertyValue.java | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/35ba1129/compiler/src/org/apache/flex/compiler/internal/css/CSSColorPropertyValue.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/css/CSSColorPropertyValue.java b/compiler/src/org/apache/flex/compiler/internal/css/CSSColorPropertyValue.java
index b63cf1f..909d2b5 100644
--- a/compiler/src/org/apache/flex/compiler/internal/css/CSSColorPropertyValue.java
+++ b/compiler/src/org/apache/flex/compiler/internal/css/CSSColorPropertyValue.java
@@ -197,10 +197,22 @@ public class CSSColorPropertyValue extends CSSPropertyValue
final TokenStream tokenStream)
{
super(tree, tokenStream, CSSModelTreeType.PROPERTY_VALUE);
- final String tokenText = tree.token.getText();
+ String tokenText = tree.token.getText();
assert tokenText.startsWith("#") : "Invalid color:" + tokenText;
this.token = tree.token;
+ if (tokenText.length() == 4)
+ {
+ StringBuilder six = new StringBuilder();
+ six.append("#");
+ six.append(tokenText.charAt(1));
+ six.append(tokenText.charAt(1));
+ six.append(tokenText.charAt(2));
+ six.append(tokenText.charAt(2));
+ six.append(tokenText.charAt(3));
+ six.append(tokenText.charAt(3));
+ tokenText = six.toString();
+ }
this.colorInt = Integer.parseInt(tokenText.substring(1), 16);
}