@soybeanjs/colord 0.0.4 → 0.0.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.
- package/dist/{colord-C3iU53g-.js → colord-CRhmzs7Q.js} +3 -3
- package/dist/colord.js +6 -6
- package/dist/{get-D0jfz1WU.js → get-DgoyZnms.js} +1 -1
- package/dist/index.js +6 -6
- package/dist/{lab-B5wAd4fu.js → lab-Cb1l0T-U.js} +1 -1
- package/dist/{manipulate-C3CvrU4m.js → manipulate-BTO-DFUg.js} +1 -1
- package/dist/plugins/a11y.js +2 -2
- package/dist/plugins/lab.js +4 -4
- package/dist/plugins/lch.js +3 -3
- package/dist/plugins/mix.js +4 -4
- package/dist/plugins/oklab.js +1 -1
- package/dist/plugins/oklch.js +1 -1
- package/dist/plugins/xyz.js +2 -2
- package/dist/{rgb-DNYno5F7.js → rgb-D5MxNcO5.js} +4 -5
- package/dist/{xyz-CXEZJhV8.js → xyz-D2aynO-Z.js} +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { l as round, v as ALPHA_PRECISION } from "./utils-DajWVr6Z.js";
|
|
2
|
-
import { a as parseRgbString, c as roundRgb, i as parseRgb, s as rgbToRgbString } from "./rgb-
|
|
2
|
+
import { a as parseRgbString, c as roundRgb, i as parseRgb, s as rgbToRgbString } from "./rgb-D5MxNcO5.js";
|
|
3
3
|
import { i as roundHsv, n as parseHsv, r as rgbToHsv } from "./hsv-BKcGyyrD.js";
|
|
4
|
-
import { a as saturate, c as rgbToHsl, l as rgbToHslString, n as invert, o as parseHsl, r as lighten, s as parseHslString, t as changeAlpha, u as roundHsl } from "./manipulate-
|
|
5
|
-
import { t as getBrightness } from "./get-
|
|
4
|
+
import { a as saturate, c as rgbToHsl, l as rgbToHslString, n as invert, o as parseHsl, r as lighten, s as parseHslString, t as changeAlpha, u as roundHsl } from "./manipulate-BTO-DFUg.js";
|
|
5
|
+
import { t as getBrightness } from "./get-DgoyZnms.js";
|
|
6
6
|
|
|
7
7
|
//#region src/models/hex.ts
|
|
8
8
|
const hexMatcher = /^#([0-9a-f]{3,8})$/i;
|
package/dist/colord.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./utils-DajWVr6Z.js";
|
|
2
|
-
import "./rgb-
|
|
3
|
-
import { n as colord, t as Colord } from "./colord-
|
|
2
|
+
import "./rgb-D5MxNcO5.js";
|
|
3
|
+
import { n as colord, t as Colord } from "./colord-CRhmzs7Q.js";
|
|
4
4
|
import "./hsv-BKcGyyrD.js";
|
|
5
|
-
import "./manipulate-
|
|
6
|
-
import "./xyz-
|
|
7
|
-
import "./lab-
|
|
8
|
-
import "./get-
|
|
5
|
+
import "./manipulate-BTO-DFUg.js";
|
|
6
|
+
import "./xyz-D2aynO-Z.js";
|
|
7
|
+
import "./lab-Cb1l0T-U.js";
|
|
8
|
+
import "./get-DgoyZnms.js";
|
|
9
9
|
|
|
10
10
|
export { Colord, colord };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./utils-DajWVr6Z.js";
|
|
2
|
-
import "./rgb-
|
|
3
|
-
import { a as parsers, i as getFormat, n as colord, r as random, t as Colord } from "./colord-
|
|
2
|
+
import "./rgb-D5MxNcO5.js";
|
|
3
|
+
import { a as parsers, i as getFormat, n as colord, r as random, t as Colord } from "./colord-CRhmzs7Q.js";
|
|
4
4
|
import "./hsv-BKcGyyrD.js";
|
|
5
|
-
import "./manipulate-
|
|
6
|
-
import "./xyz-
|
|
7
|
-
import "./lab-
|
|
8
|
-
import "./get-
|
|
5
|
+
import "./manipulate-BTO-DFUg.js";
|
|
6
|
+
import "./xyz-D2aynO-Z.js";
|
|
7
|
+
import "./lab-Cb1l0T-U.js";
|
|
8
|
+
import "./get-DgoyZnms.js";
|
|
9
9
|
|
|
10
10
|
//#region src/extend.ts
|
|
11
11
|
const activePlugins = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as mul3x3, d as M_D65_TO_D50, i as isPresent, l as round, o as parseAlpha, t as clamp, u as M_D50_TO_D65, v as ALPHA_PRECISION, y as D50 } from "./utils-DajWVr6Z.js";
|
|
2
|
-
import { i as xyzToRgb, n as rgbToXyz } from "./xyz-
|
|
2
|
+
import { i as xyzToRgb, n as rgbToXyz } from "./xyz-D2aynO-Z.js";
|
|
3
3
|
|
|
4
4
|
//#region src/models/lab.ts
|
|
5
5
|
const EPSILON = 216 / 24389;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as isPresent, l as round, n as clampHue, o as parseAlpha, s as parseHue, t as clamp, v as ALPHA_PRECISION } from "./utils-DajWVr6Z.js";
|
|
2
2
|
import { r as rgbToHsv, t as hsvToRgb } from "./hsv-BKcGyyrD.js";
|
|
3
|
-
import { a as rgbToLab, n as labToRgb, t as clampLab } from "./lab-
|
|
3
|
+
import { a as rgbToLab, n as labToRgb, t as clampLab } from "./lab-Cb1l0T-U.js";
|
|
4
4
|
|
|
5
5
|
//#region src/models/hsl.ts
|
|
6
6
|
const clampHsl = (hsl) => {
|
package/dist/plugins/a11y.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as round, r as floor } from "../utils-DajWVr6Z.js";
|
|
2
|
-
import "../rgb-
|
|
3
|
-
import { i as getLuminance, n as getContrast } from "../get-
|
|
2
|
+
import "../rgb-D5MxNcO5.js";
|
|
3
|
+
import { i as getLuminance, n as getContrast } from "../get-DgoyZnms.js";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/a11y.ts
|
|
6
6
|
/**
|
package/dist/plugins/lab.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { l as round, t as clamp } from "../utils-DajWVr6Z.js";
|
|
2
|
-
import "../rgb-
|
|
3
|
-
import "../xyz-
|
|
4
|
-
import { a as rgbToLab, i as parseLabString, o as roundLab, r as parseLab } from "../lab-
|
|
5
|
-
import { r as getDeltaE2000 } from "../get-
|
|
2
|
+
import "../rgb-D5MxNcO5.js";
|
|
3
|
+
import "../xyz-D2aynO-Z.js";
|
|
4
|
+
import { a as rgbToLab, i as parseLabString, o as roundLab, r as parseLab } from "../lab-Cb1l0T-U.js";
|
|
5
|
+
import { r as getDeltaE2000 } from "../get-DgoyZnms.js";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/lab.ts
|
|
8
8
|
/**
|
package/dist/plugins/lch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as isPresent, l as round, n as clampHue, o as parseAlpha, s as parseHue, t as clamp, v as ALPHA_PRECISION } from "../utils-DajWVr6Z.js";
|
|
2
|
-
import "../rgb-
|
|
3
|
-
import "../xyz-
|
|
4
|
-
import { a as rgbToLab, n as labToRgb } from "../lab-
|
|
2
|
+
import "../rgb-D5MxNcO5.js";
|
|
3
|
+
import "../xyz-D2aynO-Z.js";
|
|
4
|
+
import { a as rgbToLab, n as labToRgb } from "../lab-Cb1l0T-U.js";
|
|
5
5
|
|
|
6
6
|
//#region src/models/lch.ts
|
|
7
7
|
/**
|
package/dist/plugins/mix.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../utils-DajWVr6Z.js";
|
|
2
|
-
import "../rgb-
|
|
2
|
+
import "../rgb-D5MxNcO5.js";
|
|
3
3
|
import "../hsv-BKcGyyrD.js";
|
|
4
|
-
import { i as mix } from "../manipulate-
|
|
5
|
-
import "../xyz-
|
|
6
|
-
import "../lab-
|
|
4
|
+
import { i as mix } from "../manipulate-BTO-DFUg.js";
|
|
5
|
+
import "../xyz-D2aynO-Z.js";
|
|
6
|
+
import "../lab-Cb1l0T-U.js";
|
|
7
7
|
|
|
8
8
|
//#region src/plugins/mix.ts
|
|
9
9
|
/**
|
package/dist/plugins/oklab.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as OKLAB_M2_INV, a as mul3x3, c as parseValueToDecimal, g as OKLAB_M2, h as OKLAB_M1_INV, i as isPresent, l as round, m as OKLAB_M1, o as parseAlpha, t as clamp, v as ALPHA_PRECISION } from "../utils-DajWVr6Z.js";
|
|
2
|
-
import { n as clampRgb, o as rgbToLinearRgb, r as linearRgbToRgb, t as clampLinearRgb } from "../rgb-
|
|
2
|
+
import { n as clampRgb, o as rgbToLinearRgb, r as linearRgbToRgb, t as clampLinearRgb } from "../rgb-D5MxNcO5.js";
|
|
3
3
|
|
|
4
4
|
//#region src/models/oklab.ts
|
|
5
5
|
const clampOklab = (oklab) => {
|
package/dist/plugins/oklch.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as OKLAB_M2_INV, a as mul3x3, c as parseValueToDecimal, g as OKLAB_M2, h as OKLAB_M1_INV, i as isPresent, l as round, m as OKLAB_M1, n as clampHue, o as parseAlpha, s as parseHue, t as clamp, v as ALPHA_PRECISION } from "../utils-DajWVr6Z.js";
|
|
2
|
-
import { n as clampRgb, o as rgbToLinearRgb, r as linearRgbToRgb, t as clampLinearRgb } from "../rgb-
|
|
2
|
+
import { n as clampRgb, o as rgbToLinearRgb, r as linearRgbToRgb, t as clampLinearRgb } from "../rgb-D5MxNcO5.js";
|
|
3
3
|
|
|
4
4
|
//#region src/models/oklch.ts
|
|
5
5
|
const clampOklch = (oklch) => {
|
package/dist/plugins/xyz.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../utils-DajWVr6Z.js";
|
|
2
|
-
import "../rgb-
|
|
3
|
-
import { n as rgbToXyz, r as roundXyz, t as parseXyz } from "../xyz-
|
|
2
|
+
import "../rgb-D5MxNcO5.js";
|
|
3
|
+
import { n as rgbToXyz, r as roundXyz, t as parseXyz } from "../xyz-D2aynO-Z.js";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/xyz.ts
|
|
6
6
|
/**
|
|
@@ -13,9 +13,9 @@ const clampRgb = (rgb) => {
|
|
|
13
13
|
const roundRgb = (rgb) => {
|
|
14
14
|
const { r, g, b, alpha } = rgb;
|
|
15
15
|
return {
|
|
16
|
-
r: round(r),
|
|
17
|
-
g: round(g),
|
|
18
|
-
b: round(b),
|
|
16
|
+
r: round(r, 2),
|
|
17
|
+
g: round(g, 2),
|
|
18
|
+
b: round(b, 2),
|
|
19
19
|
alpha: round(alpha, ALPHA_PRECISION)
|
|
20
20
|
};
|
|
21
21
|
};
|
|
@@ -63,8 +63,7 @@ const rgbToLinear = (value) => {
|
|
|
63
63
|
* @param value - Linear light value (0-1)
|
|
64
64
|
*/
|
|
65
65
|
function linearToRgb(value) {
|
|
66
|
-
|
|
67
|
-
return Math.round(v * 255);
|
|
66
|
+
return (value <= .0031308 ? value * 12.92 : 1.055 * value ** (1 / 2.4) - .055) * 255;
|
|
68
67
|
}
|
|
69
68
|
/**
|
|
70
69
|
* Converts an RGBA color to Linear RGB color space.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as mul3x3, f as M_SRGB_TO_XYZ_D65, i as isPresent, l as round, p as M_XYZ_D65_TO_SRGB, t as clamp, v as ALPHA_PRECISION, y as D50 } from "./utils-DajWVr6Z.js";
|
|
2
|
-
import { n as clampRgb, o as rgbToLinearRgb, r as linearRgbToRgb } from "./rgb-
|
|
2
|
+
import { n as clampRgb, o as rgbToLinearRgb, r as linearRgbToRgb } from "./rgb-D5MxNcO5.js";
|
|
3
3
|
|
|
4
4
|
//#region src/models/xyz.ts
|
|
5
5
|
/**
|