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

Add support for setting alpha values / transparent color #217

Closed
kanielrkirby opened this issue May 1, 2024 · 1 comment · Fixed by #218
Closed

Add support for setting alpha values / transparent color #217

kanielrkirby opened this issue May 1, 2024 · 1 comment · Fixed by #218

Comments

@kanielrkirby
Copy link
Contributor

I could be overlooking something, but I couldn't find any examples of setting alpha from an existing color, and the workarounds I've tried didn't work very well.

Example of desired functionality:

pastel color red | pastel set alpha 0.5
Hex: #ff000080
RGB: rgba(255, 0, 0, 0.5)
HSL: hsla(0, 100.0%, 50.0%, 0.5)

I tried mixing with white / black / grey with an opacity of 50%, but it results in colors being inaccurate

pastel mix "$(pastel color red)" "$(pastel color #FFFFFF80)"
pastel mix "$(pastel color red)" "$(pastel color #00000080)"
pastel mix "$(pastel color red)" "$(pastel color #80808080)"

Also looked for a color that might not have a direct color value, like transparent or clear, but these don't exist either.

I realize this is could be a pain to implement, so I just wanted to make an issue for it to check if this is something you plan to look into / would accept a PR for, or if this is more work than it's worth. Also if there's a workaround I don't know of, please let me know.

@sharkdp
Copy link
Owner

sharkdp commented May 5, 2024

Thank you for the report. It's been a while since I worked on this code base, to be honest. I think there is no way to do this, but I agree that pastel set alpha is something that should work. I would hope that it is easy to implement.

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 a pull request may close this issue.

2 participants