pastel icon indicating copy to clipboard operation
pastel copied to clipboard

Added `alpha` property to `set` command

Open kanielrkirby opened this issue 1 year ago • 0 comments

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 avatar May 18 '24 19:05 kanielrkirby