1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-25 13:55:34 -05:00

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

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