@soybeanjs/colord 0.4.0 → 0.4.2
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/dist/palette/index.d.ts +19 -1
- package/dist/palette/index.js +18 -1
- package/package.json +1 -1
package/dist/palette/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ interface PaletteColorItem {
|
|
|
23
23
|
* the color format is `oklch` string
|
|
24
24
|
*/
|
|
25
25
|
type TailwindPalette = { [K in TailwindPaletteKey]: { [L in PaletteColorLevel]: PaletteColorItem } };
|
|
26
|
+
type SimplePaletteKey = 'inherit' | 'current' | 'transparent' | 'black' | 'white';
|
|
26
27
|
type OutputColorMap = {
|
|
27
28
|
hex: string;
|
|
28
29
|
rgb: RgbColor;
|
|
@@ -49,6 +50,23 @@ interface NearestPalette<F extends OutputFormat> {
|
|
|
49
50
|
}
|
|
50
51
|
//#endregion
|
|
51
52
|
//#region src/palette/constant.d.ts
|
|
53
|
+
declare const simplePalette: {
|
|
54
|
+
readonly inherit: "inherit";
|
|
55
|
+
readonly current: "currentColor";
|
|
56
|
+
readonly transparent: "transparent";
|
|
57
|
+
readonly black: {
|
|
58
|
+
readonly hex: "#000000";
|
|
59
|
+
readonly rgb: "rgb(0 0 0)";
|
|
60
|
+
readonly hsl: "hsl(0 0% 0%)";
|
|
61
|
+
readonly oklch: "oklch(0% 0 0)";
|
|
62
|
+
};
|
|
63
|
+
readonly white: {
|
|
64
|
+
readonly hex: "#ffffff";
|
|
65
|
+
readonly rgb: "rgb(255 255 255)";
|
|
66
|
+
readonly hsl: "hsl(0 0% 100%)";
|
|
67
|
+
readonly oklch: "oklch(100% 0 0)";
|
|
68
|
+
};
|
|
69
|
+
};
|
|
52
70
|
declare const tailwindPalette: TailwindPalette;
|
|
53
71
|
//#endregion
|
|
54
72
|
//#region src/palette/generate.d.ts
|
|
@@ -69,4 +87,4 @@ declare function generatePalette<F extends OutputFormat = 'oklch'>(input: AnyCol
|
|
|
69
87
|
*/
|
|
70
88
|
declare function generateNearestPalette<F extends OutputFormat>(input: AnyColor, format?: F): NearestPalette<F>;
|
|
71
89
|
//#endregion
|
|
72
|
-
export { type PaletteColorLevel, type TailwindPaletteKey, type TailwindPaletteLevelColorKey, generateNearestPalette, generatePalette, tailwindPalette };
|
|
90
|
+
export { type PaletteColorLevel, type SimplePaletteKey, type TailwindPaletteKey, type TailwindPaletteLevelColorKey, generateNearestPalette, generatePalette, simplePalette, tailwindPalette };
|
package/dist/palette/index.js
CHANGED
|
@@ -10,6 +10,23 @@ import { t as extend } from "../extend-DZhKU4TR.js";
|
|
|
10
10
|
import { t as labPlugin } from "../lab-DRO6J6z8.js";
|
|
11
11
|
|
|
12
12
|
//#region src/palette/constant.ts
|
|
13
|
+
const simplePalette = {
|
|
14
|
+
inherit: "inherit",
|
|
15
|
+
current: "currentColor",
|
|
16
|
+
transparent: "transparent",
|
|
17
|
+
black: {
|
|
18
|
+
hex: "#000000",
|
|
19
|
+
rgb: "rgb(0 0 0)",
|
|
20
|
+
hsl: "hsl(0 0% 0%)",
|
|
21
|
+
oklch: "oklch(0% 0 0)"
|
|
22
|
+
},
|
|
23
|
+
white: {
|
|
24
|
+
hex: "#ffffff",
|
|
25
|
+
rgb: "rgb(255 255 255)",
|
|
26
|
+
hsl: "hsl(0 0% 100%)",
|
|
27
|
+
oklch: "oklch(100% 0 0)"
|
|
28
|
+
}
|
|
29
|
+
};
|
|
13
30
|
const tailwindPalette = {
|
|
14
31
|
neutral: {
|
|
15
32
|
"50": {
|
|
@@ -1972,4 +1989,4 @@ function generateNearestPalette(input, format = "oklch") {
|
|
|
1972
1989
|
}
|
|
1973
1990
|
|
|
1974
1991
|
//#endregion
|
|
1975
|
-
export { generateNearestPalette, generatePalette, tailwindPalette };
|
|
1992
|
+
export { generateNearestPalette, generatePalette, simplePalette, tailwindPalette };
|