This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Add support for ARGB hex strings#578
Open
chrishoage wants to merge 2 commits intodylanaraps:masterfrom
Open
Conversation
chrishoage
commented
Jan 9, 2021
Author
chrishoage
left a comment
There was a problem hiding this comment.
I didn't find any tests for the Color class, otherwise I would have updated those.
Comment on lines
+42
to
+45
| def hex_argb(self): | ||
| """Convert an alpha hex color to argb hex.""" | ||
| return "#%02X%s" % (int(int(self.alpha_num) * 255 / 100), | ||
| self.hex_color[1:]) |
Author
There was a problem hiding this comment.
I'm unsure about this name. Happy to tweak it to your liking.
Author
|
If this is not acceptable another alternative I would be open to is Lines 46 to 49 in 4997a49 That way I could achieve the same thing in my [colors]
background=#{background.alpha_hex}{background.strip}In fact, I think I will implement this in addition to what I have. Please let me know if you would like me to remove hex_argb |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Polybar only supports
#ARGBfor transparency. I previously used the workaround in #132 (comment), however this is not a particularly clean solution.With this change I can simply import
~/.cache/wal/colors-polybar.iniand have the#ARGBpre-defined with no need to pass in the color via an environment variable