Conversation
|
Hi Nick, thanks for this! A CLI for color operations has been sitting on my Someday list, so I’m glad to see it here. If that’s fine with you, I’d like to bikeshed the names of the commands and options a bit to see if we can find a good mapping to the programmatic API. I’ll get back with a proposal, and other (stylistic) notes I will add as code comments. |
|
Yes, please bikeshed those names, I wasn't totally happy with them either. Also curious to hear if you would want to pull in a CLI library to make the arg parsing better (my vanilla implementation is probably full of bugs) |
I was actually happily surprised by the no-dep approach! I wanted to suggest Node’s built-in |
|
EDIT: I'm sorry I was lazy here, I can answer that myself with a google. The answer is yes, those APIs are implemented in bun and deno. I'm not actually that familiar with the node ecosystem, if we use that node API, does that make this incompatible with other runtimes eg bun, deno? I would not want to do that. |
I wanted to be able to convert between formats on the command line, eg
pnpx culori convert '#12ff45' --to oklchThis implements this, along with a few other useful util commands. This is current usage text:
I'm not sure if this is quite the right semantics of when I log to console.error vs console.log.
This is decently well tested. This would need some documentation, but I wanted to start with this and get verification that this has some hope of getting merged before I put more effort in.