catppuccin-palette/porcelain.jq
Sam Nystrom df35c12c2f
feat: add machine-readable palette (#45)
* feat: add jq script for machine-readable palette

* feat: add machine-readable palette

* refactor: replace regex with jq filters

* build: add porcelain step to `package.json`

---------

Co-authored-by: winston <hey@winston.sh>
2023-04-02 03:03:16 +02:00

11 lines
248 B
Plaintext

map_values(map_values({
hex: .hex | ltrimstr("#"),
rgb: .raw | split(", ") | map(tonumber),
hsl: .hsl
| ltrimstr("hsl(")
| rtrimstr(")")
| split(", ")
| map(rtrimstr("%") | tonumber)
| [ .[0], .[1] / 100, .[2] / 100 ]
}))