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

Added alpha property to set command #218

Merged
merged 1 commit into from
Jun 22, 2024

Conversation

kanielrkirby
Copy link
Contributor

@kanielrkirby kanielrkirby commented May 18, 2024

Fixes #217

The lib already supported alpha, it just wasn't implemented into the CLI side of things as far as I can tell. I've added an argument to the set command, and added a match arm to handle alpha.

Here's some manual tests I've run to confirm it's functionality:

$ ./pastel color "lch(50,30,40)" | ./pastel set alpha 0.5 | ./pastel format lch
LCh(50, 30, 40, 0.5)

$ ./pastel color "hsl(134,50%,50%)" | ./pastel set alpha 0.5 | ./pastel format hsl
hsla(134, 50.0%, 50.0%, 0.5)

$ ./pastel color "hsla(253,40%,20%,0.2)" | ./pastel set alpha 0.6 | ./pastel format hsl
hsla(253, 40.0%, 20.0%, 0.6)

$ ./pastel color red | ./pastel set alpha 0.5 | ./pastel format
#ff000080

If you think either a) some testing, or b) a transparent color name would be nice, just let me know and I'll get that done.

@kanielrkirby kanielrkirby changed the title Added alpha property to set command - Fixes #217 Added alpha property to set command May 18, 2024
Copy link
Owner

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@sharkdp sharkdp merged commit fc28c4a into sharkdp:master Jun 22, 2024
15 checks passed
@kanielrkirby kanielrkirby deleted the feature/add-alpha-property branch June 23, 2024 01:26
@hustcer
Copy link

hustcer commented Aug 18, 2024

@sharkdp When will there be a new release? Thanks, I want to try this feature in the CLI.

@sharkdp
Copy link
Owner

sharkdp commented Sep 6, 2024

https://github.com/sharkdp/pastel/releases/tag/v0.10.0

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.

Add support for setting alpha values / transparent color
3 participants