Skip to content
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

adjust_alpha #85

Merged
merged 1 commit into from
Nov 26, 2024
Merged

adjust_alpha #85

merged 1 commit into from
Nov 26, 2024

Conversation

eylles
Copy link
Owner

@eylles eylles commented Nov 26, 2024

@Ciavi i find interest in this, please elaborate is this intended to be used with the -a flag in some manner?

@Ciavi
Copy link
Contributor

Ciavi commented Nov 26, 2024

@Ciavi i find interest in this, please elaborate is this intended to be used with the -a flag in some manner?

Hello @eylles , sure thing, I'll elaborate.
This piece of code is meant to be used in templates files in the following way (I'll post an example I used for Waybar):

@define-color foreground {foreground};
@define-color background {background.adjust_alpha(50).rgba};
@define-color background-tooltip {background};

What it does is very simple (and pretty dumb to be fair): it just creates a shallow copy of the color instance we are using, adjusts alpha_num and returns such copy, never changing the original: that way the original instance remains untouched and ready for use somewhere else.

This has not seen much use in my personal experience with pywal as most programs which support transparency, whether it is through #rrggbbaa or rgba(r, g, b, a), don't really need such function. I also have not investigated whether this has a significant impact on performance.

@eylles
Copy link
Owner Author

eylles commented Nov 26, 2024

yeh i like the idea, may be a bit niche but is not like pywal16 doesn't got other niche stuff so i'll add it.

@eylles eylles merged commit 2dbf6b4 into master Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants