diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-05-13 22:51:10 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-05-13 22:51:10 +0200 |
commit | 94ee637102c6d5c6d40edc1e25a70fbfbc3369c3 (patch) | |
tree | 22467a4371f2ed17080a682d67a5853fda3ff4c1 /lexer | |
parent | c54a817555ed8ac2a2f02805451e7667cbd42d76 (diff) |
[Parser] Fix HWB parser alpha channel and add test.
Diffstat (limited to 'lexer')
-rw-r--r-- | lexer/theme-parser.y | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y index 41ed3e87..bf0019e0 100644 --- a/lexer/theme-parser.y +++ b/lexer/theme-parser.y @@ -444,7 +444,6 @@ t_property_color } /** hwb ( 0-360 , 0-100 %, 0 - 100 %) */ | T_COL_HWB T_PARENT_LEFT T_INT T_COMMA t_property_color_value T_PERCENT T_COMMA t_property_color_value T_PERCENT T_PARENT_RIGHT { - $$.alpha = 1.0; if ( ! check_in_range($3,0,360, &(@$)) ) { YYABORT; } if ( ! check_in_range($5,0,100, &(@$)) ) { YYABORT; } if ( ! check_in_range($8,0,100, &(@$)) ) { YYABORT; } @@ -452,6 +451,7 @@ t_property_color double w = $5/100.0; double b = $8/100.0; $$ = hsl_to_rgb ( h, 1.0, 0.5); + $$.alpha = 1.0; $$.red *= ( 1. - w - b ); $$.red += w; $$.green *= ( 1. - w - b ); |