diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-04-26 22:45:14 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-04-26 22:45:14 +0200 |
commit | 484aa35716d3fb627245834cb15b106e88a4bda6 (patch) | |
tree | e74dfee0566db98f0ca78a922604de462593abc5 /lexer | |
parent | d79423f2cfe1db48300d1d3aee7d82f83ffa9f05 (diff) |
[Lexer] Fix color parsing.
Diffstat (limited to 'lexer')
-rw-r--r-- | lexer/theme-lexer.l | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l index c6a7795f..ccd08976 100644 --- a/lexer/theme-lexer.l +++ b/lexer/theme-lexer.l @@ -433,17 +433,17 @@ if ( queue == NULL ){ } <PROPERTIES>rgba\({NUMBER}{1,3},{NUMBER}{1,3},{NUMBER}{1,3},[01](\.{NUMBER}+)?\) { char *endptr = &yytext[5]; - yylval->colorval.red = g_ascii_strtoull ( endptr, &endptr, 10); - yylval->colorval.green= g_ascii_strtoull ( endptr+1, &endptr, 10); - yylval->colorval.blue= g_ascii_strtoull ( endptr+1, &endptr, 10); + yylval->colorval.red = g_ascii_strtoull ( endptr, &endptr, 10)/255.0; + yylval->colorval.green= g_ascii_strtoull ( endptr+1, &endptr, 10)/255.0; + yylval->colorval.blue= g_ascii_strtoull ( endptr+1, &endptr, 10)/255.0; yylval->colorval.alpha= g_ascii_strtod ( endptr+1, NULL); return T_COLOR; } <PROPERTIES>rgb\({NUMBER}{1,3},{NUMBER}{1,3},{NUMBER}{1,3}\) { char *endptr = &yytext[4]; - yylval->colorval.red = g_ascii_strtoull ( endptr, &endptr, 10); - yylval->colorval.green = g_ascii_strtoull ( endptr+1, &endptr, 10); - yylval->colorval.blue = g_ascii_strtoull ( endptr+1, &endptr, 10); + yylval->colorval.red = g_ascii_strtoull ( endptr, &endptr, 10)/255.0; + yylval->colorval.green = g_ascii_strtoull ( endptr+1, &endptr, 10)/255.0; + yylval->colorval.blue = g_ascii_strtoull ( endptr+1, &endptr, 10)/255.0; yylval->colorval.alpha = 1.0; return T_COLOR; } |