diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-05-15 09:10:02 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-05-15 09:10:02 +0200 |
commit | f0ceeb86d8f11526fc2fd52c3ef8e3c9e340a20f (patch) | |
tree | ce9d50e1697d37f003ca932f116fe91d975caca5 /lexer/theme-parser.y | |
parent | 9d068151fdbad2710b1fe9294c21c4c9d28ca15b (diff) |
[Lexer] Support hsla
Diffstat (limited to 'lexer/theme-parser.y')
-rw-r--r-- | lexer/theme-parser.y | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y index bf0019e0..1ccc551e 100644 --- a/lexer/theme-parser.y +++ b/lexer/theme-parser.y @@ -500,6 +500,17 @@ t_property_color $$ = hsl_to_rgb ( h/360.0, s/100.0, l/100.0 ); $$.alpha = 1.0; } + /** hsl ( 0-360 , 0-100 %, 0 - 100 %) */ +| T_COL_HSL T_PARENT_LEFT T_INT T_COMMA t_property_color_value T_PERCENT T_COMMA t_property_color_value T_PERCENT T_COMMA t_property_color_value T_PERCENT T_PARENT_RIGHT { + if ( ! check_in_range($3, 0,360, &(@$)) ) { YYABORT; } + if ( ! check_in_range($5, 0,100, &(@$)) ) { YYABORT; } + if ( ! check_in_range($8, 0,100, &(@$)) ) { YYABORT; } + gdouble h = $3; + gdouble s = $5; + gdouble l = $8; + $$ = hsl_to_rgb ( h/360.0, s/100.0, l/100.0 ); + $$.alpha = $11/100.0; +} /** Hex colors parsed by lexer. */ | T_COLOR { $$ = $1; |