@nightshadeui/palette-generator 3.1.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @nightshadeui/palette-generator
|
|
2
|
+
|
|
3
|
+
The library behind `nightshade palette`: scheme-aware OKLCH ramps and tone contexts from a palette spec.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm i @nightshadeui/palette-generator
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { generatePaletteCss, PaletteSpecSchema } from '@nightshadeui/palette-generator';
|
|
11
|
+
|
|
12
|
+
const spec = PaletteSpecSchema.decode(JSON.parse(input));
|
|
13
|
+
const css = generatePaletteCss(spec, ':root');
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
A spec has twelve-step `lightnessCurve` and `chromaCurve`, and `ramps` of `{ name, hue, chroma, lightness }`. It must keep `base`, `primary` and `secondary`: the styles read them by name.
|