diff options
author | Dave Davenport <qball@gmpclient.org> | 2016-12-13 08:00:35 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2016-12-13 08:00:35 +0100 |
commit | fcba4b8d34408109ffc1610bd590dad9c4dfa242 (patch) | |
tree | 5d9f5be078eab7356ecfd015c9ba113392f06fd9 | |
parent | 38035568f375c701d49658adbe9c7d632d584b31 (diff) |
Support old argb:{HEX}{8} format.
-rw-r--r-- | lexer/theme-lexer.l | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l index a645138a..62f6dd9b 100644 --- a/lexer/theme-lexer.l +++ b/lexer/theme-lexer.l @@ -93,6 +93,15 @@ YY_LLOC_START yylval->colorval.blue = val.b/255.0; return T_COLOR; } +<PROPERTIES>argb:{HEX}{8} { + union { unsigned int val; struct { unsigned char b,g,r,a;};} val; + val.val = (unsigned int)strtoull ( &yytext[1], NULL, 16); + yylval->colorval.alpha = val.a/255.0; + yylval->colorval.red = val.r/255.0; + yylval->colorval.green = val.g/255.0; + yylval->colorval.blue = val.b/255.0; + return T_COLOR; +} <PROPERTIES>#{HEX}{6} { union { unsigned int val; struct { unsigned char b,g,r,a;};} val; val.val = (unsigned int)g_ascii_strtoull ( &yytext[1], NULL, 16); |