-
Notifications
You must be signed in to change notification settings - Fork 665
[Theme] add alpha override support to references and hex colors. #2202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This overrides the alpha that is (possibly) already set.
maybe a *= instead of =?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it guaranteed that the 'link' points to a color?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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