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>
This commit is contained in:
parent
baa0469b86
commit
df35c12c2f
3 changed files with 1375 additions and 1 deletions
|
@ -15,7 +15,9 @@
|
|||
},
|
||||
"scripts": {
|
||||
"test": "ava",
|
||||
"build": "node esbuild.js",
|
||||
"build:npm": "node esbuild.js",
|
||||
"build:json": "jq -f porcelain.jq palette.json > palette-porcelain.json",
|
||||
"build": "npm run build:npm && npm run build:json",
|
||||
"prepublishOnly": "npm run build",
|
||||
"release": "standard-version"
|
||||
},
|
||||
|
|
1362
palette-porcelain.json
Normal file
1362
palette-porcelain.json
Normal file
File diff suppressed because it is too large
Load diff
10
porcelain.jq
Normal file
10
porcelain.jq
Normal file
|
@ -0,0 +1,10 @@
|
|||
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 ]
|
||||
}))
|
Loading…
Reference in a new issue