Support old argb:{HEX}{8} format.

This commit is contained in:
Dave Davenport 2016-12-13 08:00:35 +01:00
parent 38035568f3
commit fcba4b8d34
1 changed files with 9 additions and 0 deletions

View File

@ -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);