@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
- return alpha < 1 ? `oklch(${l * 100}% ${c} ${h} / ${alpha})` : `oklch(${l * 100}% ${c} ${h})`;
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-Bui-ARPL.js";
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";
@@ -1,4 +1,4 @@
1
- import { a as parsers, t as Colord } from "./colord-Bui-ARPL.js";
1
+ import { a as parsers, t as Colord } from "./colord-BB4wQYGd.js";
2
2
 
3
3
  //#region src/extend.ts
4
4
  const activePlugins = [];
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-Bui-ARPL.js";
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-JGZdW35H.js";
9
+ import { t as extend } from "./extend-DZhKU4TR.js";
10
10
 
11
11
  export { Colord, colord, extend, getFormat, random };
@@ -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
  /**
@@ -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-Bui-ARPL.js";
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-JGZdW35H.js";
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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@soybeanjs/colord",
3
3
  "type": "module",
4
- "version": "0.3.4",
4
+ "version": "0.3.5",
5
5
  "description": "A tiny yet powerful tool for high-performance color manipulations and conversions",
6
6
  "author": {
7
7
  "name": "Soybean",