[Theme] add alpha override support to references and hex colors.#2202
[Theme] add alpha override support to references and hex colors.#2202auregosu wants to merge 2 commits intodavatorium:nextfrom
Conversation
lexer/theme-parser.y
Outdated
| | T_COLOR { | ||
| | T_COLOR t_property_color_opt_alpha_ws { | ||
| $$ = $1; | ||
| $$.alpha = $2; |
There was a problem hiding this comment.
This overrides the alpha that is (possibly) already set.
maybe a *= instead of =?
There was a problem hiding this comment.
i made it analogous to the already existing behavior for named colors on line 1019:
| T_COLOR_NAME t_property_color_opt_alpha_ws {
$$ = $1;
$$.alpha = $2;
}
it's probably fine to leave it this way.
| if (pv->value.link.ref == NULL) { | ||
| rofi_theme_resolve_modified_link(pv); | ||
| if (pv->value.link.ref) { | ||
| ThemeColor referenced_color = pv->value.link.ref->value.color; |
There was a problem hiding this comment.
is it guaranteed that the 'link' points to a color?
There was a problem hiding this comment.
i'll add a check for the type of pv->value.link.ref on line 1598. should there be a warning if it's otherwise?
There was a problem hiding this comment.
A g_debug should be fine and the color should not be set.
(I think this is normal behaviour if you try to set color to f.e. a boolean.. the color is not set, and 'Theme entry: ... unset" is printed in debug.)
b0e758e to
81ab7f9
Compare
this adds support for the syntax `@color / 50%;` and `#123456 / 50%` to override the alpha of a given color. - extended grammar rules for `t_property_element` and `t_property_color` - added `gboolean` member to link `union` to differentiate modified links from normal links - added definition of `rofi_theme_resolve_modified_link()` - added implementation of modified link resolving in `rofi_theme_parse_process_links_int()`
|
sorry for force pushing yet again. i corrected the alpha overriding of hex colors so it only happens when |
this adds support for the syntax
@color / 50%;and#123456 / 50%to override the alpha of a given color.t_property_elementandt_property_colorgbooleanmember to linkunionto differentiate modified links from normal linksrofi_theme_resolve_modified_link()rofi_theme_parse_process_links_int()#2200