@soybeanjs/colord 0.3.4 → 0.3.5
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.
|
@@ -183,7 +183,8 @@ const parseOklchString = (input) => {
|
|
|
183
183
|
};
|
|
184
184
|
const toOklchString = (oklch) => {
|
|
185
185
|
const { l, c, h, alpha } = roundOklch(oklch);
|
|
186
|
-
|
|
186
|
+
const percent = round(l * 100, 1);
|
|
187
|
+
return alpha < 1 ? `oklch(${percent}% ${c} ${h} / ${alpha})` : `oklch(${percent}% ${c} ${h})`;
|
|
187
188
|
};
|
|
188
189
|
const rgbToOklchString = (rgb) => {
|
|
189
190
|
return toOklchString(rgbToOklch(rgb));
|
package/dist/colord.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./utils-CshL9w1R.js";
|
|
2
2
|
import "./rgb-DzRkOBLO.js";
|
|
3
|
-
import { n as colord, t as Colord } from "./colord-
|
|
3
|
+
import { n as colord, t as Colord } from "./colord-BB4wQYGd.js";
|
|
4
4
|
import "./hsv-OOAVcaRH.js";
|
|
5
5
|
import "./manipulate-Cf2MhO9I.js";
|
|
6
6
|
import "./xyz-WMIP19rd.js";
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./utils-CshL9w1R.js";
|
|
2
2
|
import "./rgb-DzRkOBLO.js";
|
|
3
|
-
import { i as getFormat, n as colord, r as random, t as Colord } from "./colord-
|
|
3
|
+
import { i as getFormat, n as colord, r as random, t as Colord } from "./colord-BB4wQYGd.js";
|
|
4
4
|
import "./hsv-OOAVcaRH.js";
|
|
5
5
|
import "./manipulate-Cf2MhO9I.js";
|
|
6
6
|
import "./xyz-WMIP19rd.js";
|
|
7
7
|
import "./lab-NxNRMUqK.js";
|
|
8
8
|
import "./get-B9GsrsfV.js";
|
|
9
|
-
import { t as extend } from "./extend-
|
|
9
|
+
import { t as extend } from "./extend-DZhKU4TR.js";
|
|
10
10
|
|
|
11
11
|
export { Colord, colord, extend, getFormat, random };
|
package/dist/palette/index.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ declare const tailwindPaletteHsl: TailwindPalette;
|
|
|
62
62
|
* @param [format] - the format of the output color, default is 'oklch'
|
|
63
63
|
* @returns the palette
|
|
64
64
|
*/
|
|
65
|
-
declare function generatePalette<F extends OutputFormat>(input: AnyColor, format?: F): Record<PaletteColorLevel, OutputColorMap[F]>;
|
|
65
|
+
declare function generatePalette<F extends OutputFormat = 'oklch'>(input: AnyColor, format?: F): Record<PaletteColorLevel, OutputColorMap[F]>;
|
|
66
66
|
//#endregion
|
|
67
67
|
//#region src/palette/nearest.d.ts
|
|
68
68
|
/**
|
package/dist/palette/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "../utils-CshL9w1R.js";
|
|
2
2
|
import "../rgb-DzRkOBLO.js";
|
|
3
|
-
import { n as colord, o as keysOf } from "../colord-
|
|
3
|
+
import { n as colord, o as keysOf } from "../colord-BB4wQYGd.js";
|
|
4
4
|
import "../hsv-OOAVcaRH.js";
|
|
5
5
|
import "../manipulate-Cf2MhO9I.js";
|
|
6
6
|
import "../xyz-WMIP19rd.js";
|
|
7
7
|
import "../lab-NxNRMUqK.js";
|
|
8
8
|
import "../get-B9GsrsfV.js";
|
|
9
|
-
import { t as extend } from "../extend-
|
|
9
|
+
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
|