sharkdp / pastel

A command-line tool to generate, analyze, convert and manipulate colors
Apache License 2.0
4.98k stars 97 forks source link

Fix CMYK from-conversion and add it as possible color function #200

Open Betelgeuse1 opened 8 months ago

Betelgeuse1 commented 8 months ago

I stumbled across this project yesterday, and it's a really cool tool :)

I'm trying to create a colorscheme for my text editor base on some design book I own, in which all colors are specified using the CMYK format. Using pastel to convert from CMYK to hex, so my editor would understand it, seemed like a no-brainer, but even though the Self::from(CMYK) function exists, it is never used anywhere in the project. Also, I've noticed the calculation were wrong in that function, so I fixed those and add the corresponding parse_cmyk function, so it can be used as a color value in commands.

This is my first time "writing" rust code, please feel free to report any mistake I've made :) I would understand if this is rejected because it's too niche of a usage.

sharkdp commented 8 months ago

but even though the Self::from(CMYK) function exists, it is never used anywhere in the project.

Strange…

Also, I've noticed the calculation were wrong in that function, so I fixed those and add the corresponding parse_cmyk function, so it can be used as a color value in commands.

Thank you!