@soybeanjs/colord 0.0.8 → 0.1.1
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 +13 -1
- package/dist/{colord-DjohCNUk.d.ts → colord-iJvjkDaN.d.ts} +1 -1
- package/dist/colord.d.ts +1 -1
- package/dist/{extend-DmcZT4-q.d.ts → extend-BwkxQVzY.d.ts} +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/palette/index.d.ts +1 -1
- package/dist/plugins/a11y.d.ts +2 -2
- package/dist/plugins/cmyk.d.ts +2 -2
- package/dist/plugins/harmonies.d.ts +1 -1
- package/dist/plugins/hwb.d.ts +2 -2
- package/dist/plugins/lab.d.ts +2 -2
- package/dist/plugins/lch.d.ts +2 -2
- package/dist/plugins/minify.d.ts +1 -1
- package/dist/plugins/mix.d.ts +2 -2
- package/dist/plugins/names.d.ts +1 -1
- package/dist/plugins/oklab.d.ts +2 -2
- package/dist/plugins/oklch.d.ts +2 -2
- package/dist/plugins/xyz.d.ts +2 -2
- package/dist/{types-B93dJkfp.d.ts → types-CV5bTriG.d.ts} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
|
|
18
18
|
## Differences from [colord](https://github.com/omgovich/colord)
|
|
19
19
|
|
|
20
|
-
- support `oklab` and `oklch` color
|
|
20
|
+
- support `oklab` and `oklch` color models
|
|
21
|
+
- support `palette` API to generate and find the nearest palette color
|
|
21
22
|
- more correct color parsing
|
|
22
23
|
- simplify type definitions
|
|
23
24
|
- rewrite color string parsing
|
|
@@ -38,6 +39,16 @@ colord("hsl(0, 50%, 50%)").darken(0.25).toHex(); // "#602020"
|
|
|
38
39
|
colord({ r: 128, g: 128, b: 128, alpha: 0.25 }).toRgbString(); // "rgba(128, 128, 128, 0.25)"
|
|
39
40
|
```
|
|
40
41
|
|
|
42
|
+
## Palette API
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { tailwindPalette, generatePalette, generateNearestPalette } from '@soybeanjs/colord/palette';
|
|
46
|
+
|
|
47
|
+
tailwindPalette.slate['500']; // 'oklch(55.4% 0.046 257.417)'
|
|
48
|
+
generatePalette('red'); // generate the palette of the color 'red'
|
|
49
|
+
generateNearestPalette('red'); // find the nearest color in the palette of the color 'red'
|
|
50
|
+
```
|
|
51
|
+
|
|
41
52
|
## Supported Color Models
|
|
42
53
|
|
|
43
54
|
- Hexadecimal strings (including 3, 4 and 8 digit notations)
|
|
@@ -53,6 +64,7 @@ colord({ r: 128, g: 128, b: 128, alpha: 0.25 }).toRgbString(); // "rgba(128, 128
|
|
|
53
64
|
- OKLAB objects ([via plugin](#plugins))
|
|
54
65
|
- OKLCH objects ([via plugin](#plugins))
|
|
55
66
|
|
|
67
|
+
|
|
56
68
|
## More API
|
|
57
69
|
|
|
58
70
|
see the more api in [colord](https://github.com/omgovich/colord)
|
package/dist/colord.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as colord, t as Colord } from "./colord-
|
|
1
|
+
import { n as colord, t as Colord } from "./colord-iJvjkDaN.js";
|
|
2
2
|
export { Colord, colord };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as Parsers } from "./types-
|
|
2
|
-
import { t as Colord } from "./colord-
|
|
1
|
+
import { _ as Parsers } from "./types-CV5bTriG.js";
|
|
2
|
+
import { t as Colord } from "./colord-iJvjkDaN.js";
|
|
3
3
|
|
|
4
4
|
//#region src/extend.d.ts
|
|
5
5
|
type Plugin = (ColordClass: typeof Colord, parsers: Parsers) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as HsvColor, b as
|
|
2
|
-
import { n as colord, t as Colord } from "./colord-
|
|
3
|
-
import { n as extend, t as Plugin } from "./extend-
|
|
1
|
+
import { a as HsvColor, b as TailwindPaletteColorKey, f as OklabColor, g as PaletteColorLevel, i as HslColor, l as LabColor, o as HwbColor, p as OklchColor, r as Format, s as Input, t as AnyColor, u as LchColor, v as RgbColor, x as XyzColor } from "./types-CV5bTriG.js";
|
|
2
|
+
import { n as colord, t as Colord } from "./colord-iJvjkDaN.js";
|
|
3
|
+
import { n as extend, t as Plugin } from "./extend-BwkxQVzY.js";
|
|
4
4
|
|
|
5
5
|
//#region src/shared/parse.d.ts
|
|
6
6
|
|
|
@@ -12,4 +12,4 @@ declare const getFormat: (input: Input) => Format | undefined;
|
|
|
12
12
|
//#region src/shared/random.d.ts
|
|
13
13
|
declare const random: () => Colord;
|
|
14
14
|
//#endregion
|
|
15
|
-
export { type AnyColor, Colord, type HslColor, type HsvColor, type HwbColor, type LabColor, type LchColor, type OklabColor, type OklchColor, type Plugin, type RgbColor, type XyzColor, colord, extend, getFormat, random };
|
|
15
|
+
export { type AnyColor, Colord, type HslColor, type HsvColor, type HwbColor, type LabColor, type LchColor, type OklabColor, type OklchColor, type PaletteColorLevel, type Plugin, type RgbColor, type TailwindPaletteColorKey, type XyzColor, colord, extend, getFormat, random };
|
package/dist/palette/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as NearestPalette, g as PaletteColorLevel, h as OutputFormat, m as OutputColorMap, t as AnyColor, y as TailwindPaletteColor } from "../types-
|
|
1
|
+
import { d as NearestPalette, g as PaletteColorLevel, h as OutputFormat, m as OutputColorMap, t as AnyColor, y as TailwindPaletteColor } from "../types-CV5bTriG.js";
|
|
2
2
|
|
|
3
3
|
//#region src/palette/constant.d.ts
|
|
4
4
|
|
package/dist/plugins/a11y.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as AnyColor } from "../types-
|
|
2
|
-
import { t as Plugin } from "../extend-
|
|
1
|
+
import { t as AnyColor } from "../types-CV5bTriG.js";
|
|
2
|
+
import { t as Plugin } from "../extend-BwkxQVzY.js";
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/a11y.d.ts
|
|
5
5
|
interface ReadabilityOptions {
|
package/dist/plugins/cmyk.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as CmykColor } from "../types-
|
|
2
|
-
import { t as Plugin } from "../extend-
|
|
1
|
+
import { n as CmykColor } from "../types-CV5bTriG.js";
|
|
2
|
+
import { t as Plugin } from "../extend-BwkxQVzY.js";
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/cmyk.d.ts
|
|
5
5
|
declare module '@soybeanjs/colord' {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Plugin } from "../extend-
|
|
1
|
+
import { t as Plugin } from "../extend-BwkxQVzY.js";
|
|
2
2
|
|
|
3
3
|
//#region src/plugins/harmonies.d.ts
|
|
4
4
|
type HarmonyType = 'analogous' | 'complementary' | 'double-split-complementary' | 'rectangle' | 'split-complementary' | 'tetradic' | 'triadic';
|
package/dist/plugins/hwb.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as HwbColor } from "../types-
|
|
2
|
-
import { t as Plugin } from "../extend-
|
|
1
|
+
import { o as HwbColor } from "../types-CV5bTriG.js";
|
|
2
|
+
import { t as Plugin } from "../extend-BwkxQVzY.js";
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/hwb.d.ts
|
|
5
5
|
declare module '@soybeanjs/colord' {
|
package/dist/plugins/lab.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as LabColor, t as AnyColor } from "../types-
|
|
2
|
-
import { t as Plugin } from "../extend-
|
|
1
|
+
import { l as LabColor, t as AnyColor } from "../types-CV5bTriG.js";
|
|
2
|
+
import { t as Plugin } from "../extend-BwkxQVzY.js";
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/lab.d.ts
|
|
5
5
|
declare module '@soybeanjs/colord' {
|
package/dist/plugins/lch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u as LchColor } from "../types-
|
|
2
|
-
import { t as Plugin } from "../extend-
|
|
1
|
+
import { u as LchColor } from "../types-CV5bTriG.js";
|
|
2
|
+
import { t as Plugin } from "../extend-BwkxQVzY.js";
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/lch.d.ts
|
|
5
5
|
declare module '@soybeanjs/colord' {
|
package/dist/plugins/minify.d.ts
CHANGED
package/dist/plugins/mix.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as AnyColor } from "../types-
|
|
2
|
-
import { t as Plugin } from "../extend-
|
|
1
|
+
import { t as AnyColor } from "../types-CV5bTriG.js";
|
|
2
|
+
import { t as Plugin } from "../extend-BwkxQVzY.js";
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/mix.d.ts
|
|
5
5
|
declare module '@soybeanjs/colord' {
|
package/dist/plugins/names.d.ts
CHANGED
package/dist/plugins/oklab.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as OklabColor } from "../types-
|
|
2
|
-
import { t as Plugin } from "../extend-
|
|
1
|
+
import { f as OklabColor } from "../types-CV5bTriG.js";
|
|
2
|
+
import { t as Plugin } from "../extend-BwkxQVzY.js";
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/oklab.d.ts
|
|
5
5
|
declare module '@soybeanjs/colord' {
|
package/dist/plugins/oklch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as OklchColor } from "../types-
|
|
2
|
-
import { t as Plugin } from "../extend-
|
|
1
|
+
import { p as OklchColor } from "../types-CV5bTriG.js";
|
|
2
|
+
import { t as Plugin } from "../extend-BwkxQVzY.js";
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/oklch.d.ts
|
|
5
5
|
declare module '@soybeanjs/colord' {
|
package/dist/plugins/xyz.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Plugin } from "../extend-
|
|
1
|
+
import { x as XyzColor } from "../types-CV5bTriG.js";
|
|
2
|
+
import { t as Plugin } from "../extend-BwkxQVzY.js";
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/xyz.d.ts
|
|
5
5
|
declare module '@soybeanjs/colord' {
|
|
@@ -109,4 +109,4 @@ interface NearestPalette<F extends OutputFormat> {
|
|
|
109
109
|
palette: Record<PaletteColorLevel, OutputColorMap[F]>;
|
|
110
110
|
}
|
|
111
111
|
//#endregion
|
|
112
|
-
export { Parsers as _, HsvColor as a,
|
|
112
|
+
export { Parsers as _, HsvColor as a, TailwindPaletteColorKey as b, InputSource as c, NearestPalette as d, OklabColor as f, PaletteColorLevel as g, OutputFormat as h, HslColor as i, LabColor as l, OutputColorMap as m, CmykColor as n, HwbColor as o, OklchColor as p, Format as r, Input as s, AnyColor as t, LchColor as u, RgbColor as v, XyzColor as x, TailwindPaletteColor as y };
|