feat: add jq script for machine-readable palette

This commit is contained in:
Sam Nystrom 2023-03-28 09:08:48 -04:00
parent 530db7cbcb
commit 7e5d18a69f

8
porcelain.jq Normal file
View file

@ -0,0 +1,8 @@
map_values(map_values({
hex: .hex | ltrimstr("#"),
rgb: .raw | split(", ") | map(tonumber),
hsl: .hsl
| capture("hsl\\((?<h>\\d+),\\s*(?<s>\\d+)%,\\s*(?<l>\\d+)%\\)")
| map(tonumber)
| [ .[0], .[1] / 100, .[2] / 100 ]
}))