@zag-js/color-utils 2.0.0-next.2 → 2.0.0-next.4

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.
Files changed (62) hide show
  1. package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/defineProperty.js +11 -0
  2. package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/defineProperty.mjs +11 -0
  3. package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/toPrimitive.js +13 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/toPrimitive.mjs +13 -0
  5. package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/toPropertyKey.js +8 -0
  6. package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/toPropertyKey.mjs +8 -0
  7. package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/typeof.js +15 -0
  8. package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/typeof.mjs +10 -0
  9. package/dist/area-gradient.d.mts +9 -11
  10. package/dist/area-gradient.d.ts +9 -11
  11. package/dist/area-gradient.js +58 -89
  12. package/dist/area-gradient.mjs +54 -77
  13. package/dist/color-format-gradient.d.mts +76 -78
  14. package/dist/color-format-gradient.d.ts +76 -78
  15. package/dist/color-format-gradient.js +118 -185
  16. package/dist/color-format-gradient.mjs +104 -152
  17. package/dist/color.d.mts +20 -23
  18. package/dist/color.d.ts +20 -23
  19. package/dist/color.js +57 -83
  20. package/dist/color.mjs +53 -60
  21. package/dist/gamut.d.mts +2 -5
  22. package/dist/gamut.d.ts +2 -5
  23. package/dist/gamut.js +12 -34
  24. package/dist/gamut.mjs +8 -11
  25. package/dist/hsb-color.d.mts +37 -40
  26. package/dist/hsb-color.d.ts +37 -40
  27. package/dist/hsb-color.js +164 -200
  28. package/dist/hsb-color.mjs +158 -175
  29. package/dist/hsl-color.d.mts +33 -36
  30. package/dist/hsl-color.d.ts +33 -36
  31. package/dist/hsl-color.js +139 -168
  32. package/dist/hsl-color.mjs +132 -142
  33. package/dist/index.d.mts +8 -7
  34. package/dist/index.d.ts +8 -7
  35. package/dist/index.js +23 -60
  36. package/dist/index.mjs +2 -28
  37. package/dist/native-color.d.mts +1 -3
  38. package/dist/native-color.d.ts +1 -3
  39. package/dist/native-color.js +16 -39
  40. package/dist/native-color.mjs +12 -16
  41. package/dist/oklab-color.d.mts +57 -60
  42. package/dist/oklab-color.d.ts +57 -60
  43. package/dist/oklab-color.js +363 -379
  44. package/dist/oklab-color.mjs +353 -350
  45. package/dist/oklab-math.d.mts +26 -28
  46. package/dist/oklab-math.d.ts +26 -28
  47. package/dist/oklab-math.js +123 -142
  48. package/dist/oklab-math.mjs +108 -108
  49. package/dist/parse-color.d.mts +3 -6
  50. package/dist/parse-color.d.ts +3 -6
  51. package/dist/parse-color.js +22 -48
  52. package/dist/parse-color.mjs +13 -20
  53. package/dist/rgb-color.d.mts +33 -36
  54. package/dist/rgb-color.d.ts +33 -36
  55. package/dist/rgb-color.js +182 -220
  56. package/dist/rgb-color.mjs +174 -193
  57. package/dist/types.d.mts +82 -84
  58. package/dist/types.d.ts +82 -84
  59. package/dist/types.js +4 -18
  60. package/dist/types.mjs +1 -0
  61. package/package.json +3 -3
  62. package/dist/chunk-QZ7TP4HQ.mjs +0 -7
@@ -1,179 +1,162 @@
1
- import {
2
- __publicField
3
- } from "./chunk-QZ7TP4HQ.mjs";
4
-
5
- // src/hsb-color.ts
6
- import { clampValue, mod, toFixedNumber } from "@zag-js/utils";
7
1
  import { Color } from "./color.mjs";
8
2
  import { HSLColor } from "./hsl-color.mjs";
9
3
  import { RGBColor } from "./rgb-color.mjs";
10
- var HSB_REGEX = /hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/;
11
- var _HSBColor = class _HSBColor extends Color {
12
- constructor(hue, saturation, brightness, alpha) {
13
- super();
14
- __publicField(this, "hue", hue);
15
- __publicField(this, "saturation", saturation);
16
- __publicField(this, "brightness", brightness);
17
- __publicField(this, "alpha", alpha);
18
- }
19
- /**
20
- * Create HSBColor from float sRGB values (0-1 range, clamped).
21
- * Higher precision than going through integer RGBColor (0-255).
22
- */
23
- static fromSrgbFloat(r, g, b, alpha) {
24
- const rc = Math.max(0, Math.min(1, r));
25
- const gc = Math.max(0, Math.min(1, g));
26
- const bc = Math.max(0, Math.min(1, b));
27
- const min = Math.min(rc, gc, bc);
28
- const brightness = Math.max(rc, gc, bc);
29
- const chroma = brightness - min;
30
- const saturation = brightness === 0 ? 0 : chroma / brightness;
31
- let hue = 0;
32
- if (chroma !== 0) {
33
- switch (brightness) {
34
- case rc:
35
- hue = (gc - bc) / chroma + (gc < bc ? 6 : 0);
36
- break;
37
- case gc:
38
- hue = (bc - rc) / chroma + 2;
39
- break;
40
- case bc:
41
- hue = (rc - gc) / chroma + 4;
42
- break;
43
- }
44
- hue /= 6;
45
- }
46
- return new _HSBColor(
47
- toFixedNumber(hue * 360, 4),
48
- toFixedNumber(saturation * 100, 4),
49
- toFixedNumber(brightness * 100, 4),
50
- toFixedNumber(alpha, 4)
51
- );
52
- }
53
- static parse(value) {
54
- let m;
55
- if (m = value.match(HSB_REGEX)) {
56
- const [h, s, b, a] = (m[1] ?? m[2]).split(",").map((n) => Number(n.trim().replace("%", "")));
57
- return new _HSBColor(mod(h, 360), clampValue(s, 0, 100), clampValue(b, 0, 100), clampValue(a ?? 1, 0, 1));
58
- }
59
- }
60
- toString(format = "css") {
61
- switch (format) {
62
- case "css":
63
- return this.toHSL().toString("css");
64
- case "hex":
65
- return this.toRGB().toString("hex");
66
- case "hexa":
67
- return this.toRGB().toString("hexa");
68
- case "hsb":
69
- return `hsb(${this.hue}, ${toFixedNumber(this.saturation, 2)}%, ${toFixedNumber(this.brightness, 2)}%)`;
70
- case "hsba":
71
- return `hsba(${this.hue}, ${toFixedNumber(this.saturation, 2)}%, ${toFixedNumber(this.brightness, 2)}%, ${this.alpha})`;
72
- case "hsl":
73
- return this.toHSL().toString("hsl");
74
- case "rgb":
75
- return this.toRGB().toString("rgb");
76
- default:
77
- return this.toFormat(format).toString(format);
78
- }
79
- }
80
- toFormat(format) {
81
- switch (format) {
82
- case "hsba":
83
- return this;
84
- case "hsla":
85
- return this.toHSL();
86
- case "rgba":
87
- return this.toRGB();
88
- case "oklab":
89
- case "oklch":
90
- return this.toRGB().toFormat(format);
91
- default:
92
- throw new Error("Unsupported color conversion: hsb -> " + format);
93
- }
94
- }
95
- /**
96
- * Converts a HSB color to HSL.
97
- * Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSV_to_HSL.
98
- * @returns An HSLColor object.
99
- */
100
- toHSL() {
101
- let saturation = this.saturation / 100;
102
- let brightness = this.brightness / 100;
103
- let lightness = brightness * (1 - saturation / 2);
104
- saturation = lightness === 0 || lightness === 1 ? 0 : (brightness - lightness) / Math.min(lightness, 1 - lightness);
105
- return new HSLColor(
106
- toFixedNumber(this.hue, 2),
107
- toFixedNumber(saturation * 100, 2),
108
- toFixedNumber(lightness * 100, 2),
109
- toFixedNumber(this.alpha, 2)
110
- );
111
- }
112
- /**
113
- * Converts a HSV color value to RGB.
114
- * Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSV_to_RGB_alternative.
115
- * @returns An RGBColor object.
116
- */
117
- toRGB() {
118
- let hue = this.hue;
119
- let saturation = this.saturation / 100;
120
- let brightness = this.brightness / 100;
121
- let fn = (n, k = (n + hue / 60) % 6) => brightness - saturation * brightness * Math.max(Math.min(k, 4 - k, 1), 0);
122
- return new RGBColor(
123
- Math.round(fn(5) * 255),
124
- Math.round(fn(3) * 255),
125
- Math.round(fn(1) * 255),
126
- toFixedNumber(this.alpha, 2)
127
- );
128
- }
129
- clone() {
130
- return new _HSBColor(this.hue, this.saturation, this.brightness, this.alpha);
131
- }
132
- getChannelFormatOptions(channel) {
133
- switch (channel) {
134
- case "hue":
135
- return { style: "unit", unit: "degree", unitDisplay: "narrow" };
136
- case "saturation":
137
- case "brightness":
138
- case "alpha":
139
- return { style: "percent" };
140
- default:
141
- throw new Error("Unknown color channel: " + channel);
142
- }
143
- }
144
- formatChannelValue(channel, locale) {
145
- let options = this.getChannelFormatOptions(channel);
146
- let value = this.getChannelValue(channel);
147
- if (channel === "saturation" || channel === "brightness") {
148
- value /= 100;
149
- }
150
- return new Intl.NumberFormat(locale, options).format(value);
151
- }
152
- getChannelRange(channel) {
153
- switch (channel) {
154
- case "hue":
155
- return { minValue: 0, maxValue: 360, step: 1, pageSize: 15 };
156
- case "saturation":
157
- case "brightness":
158
- return { minValue: 0, maxValue: 100, step: 1, pageSize: 10 };
159
- case "alpha":
160
- return { minValue: 0, maxValue: 1, step: 0.01, pageSize: 0.1 };
161
- default:
162
- throw new Error("Unknown color channel: " + channel);
163
- }
164
- }
165
- toJSON() {
166
- return { h: this.hue, s: this.saturation, b: this.brightness, a: this.alpha };
167
- }
168
- getFormat() {
169
- return "hsba";
170
- }
171
- getChannels() {
172
- return _HSBColor.colorChannels;
173
- }
174
- };
175
- __publicField(_HSBColor, "colorChannels", ["hue", "saturation", "brightness"]);
176
- var HSBColor = _HSBColor;
177
- export {
178
- HSBColor
4
+ import _defineProperty from "./_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/defineProperty.mjs";
5
+ import { clampValue, mod, toFixedNumber } from "@zag-js/utils";
6
+ // src/hsb-color.ts
7
+ const HSB_REGEX = /hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/;
8
+ var HSBColor = class HSBColor extends Color {
9
+ constructor(hue, saturation, brightness, alpha) {
10
+ super();
11
+ this.hue = hue;
12
+ this.saturation = saturation;
13
+ this.brightness = brightness;
14
+ this.alpha = alpha;
15
+ }
16
+ /**
17
+ * Create HSBColor from float sRGB values (0-1 range, clamped).
18
+ * Higher precision than going through integer RGBColor (0-255).
19
+ */
20
+ static fromSrgbFloat(r, g, b, alpha) {
21
+ const rc = Math.max(0, Math.min(1, r));
22
+ const gc = Math.max(0, Math.min(1, g));
23
+ const bc = Math.max(0, Math.min(1, b));
24
+ const min = Math.min(rc, gc, bc);
25
+ const brightness = Math.max(rc, gc, bc);
26
+ const chroma = brightness - min;
27
+ const saturation = brightness === 0 ? 0 : chroma / brightness;
28
+ let hue = 0;
29
+ if (chroma !== 0) {
30
+ switch (brightness) {
31
+ case rc:
32
+ hue = (gc - bc) / chroma + (gc < bc ? 6 : 0);
33
+ break;
34
+ case gc:
35
+ hue = (bc - rc) / chroma + 2;
36
+ break;
37
+ case bc: hue = (rc - gc) / chroma + 4;
38
+ }
39
+ hue /= 6;
40
+ }
41
+ return new HSBColor(toFixedNumber(hue * 360, 4), toFixedNumber(saturation * 100, 4), toFixedNumber(brightness * 100, 4), toFixedNumber(alpha, 4));
42
+ }
43
+ static parse(value) {
44
+ let m;
45
+ if (m = value.match(HSB_REGEX)) {
46
+ const [h, s, b, a] = (m[1] ?? m[2]).split(",").map((n) => Number(n.trim().replace("%", "")));
47
+ return new HSBColor(mod(h, 360), clampValue(s, 0, 100), clampValue(b, 0, 100), clampValue(a ?? 1, 0, 1));
48
+ }
49
+ }
50
+ toString(format = "css") {
51
+ switch (format) {
52
+ case "css": return this.toHSL().toString("css");
53
+ case "hex": return this.toRGB().toString("hex");
54
+ case "hexa": return this.toRGB().toString("hexa");
55
+ case "hsb": return `hsb(${this.hue}, ${toFixedNumber(this.saturation, 2)}%, ${toFixedNumber(this.brightness, 2)}%)`;
56
+ case "hsba": return `hsba(${this.hue}, ${toFixedNumber(this.saturation, 2)}%, ${toFixedNumber(this.brightness, 2)}%, ${this.alpha})`;
57
+ case "hsl": return this.toHSL().toString("hsl");
58
+ case "rgb": return this.toRGB().toString("rgb");
59
+ default: return this.toFormat(format).toString(format);
60
+ }
61
+ }
62
+ toFormat(format) {
63
+ switch (format) {
64
+ case "hsba": return this;
65
+ case "hsla": return this.toHSL();
66
+ case "rgba": return this.toRGB();
67
+ case "oklab":
68
+ case "oklch": return this.toRGB().toFormat(format);
69
+ default: throw new Error("Unsupported color conversion: hsb -> " + format);
70
+ }
71
+ }
72
+ /**
73
+ * Converts a HSB color to HSL.
74
+ * Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSV_to_HSL.
75
+ * @returns An HSLColor object.
76
+ */
77
+ toHSL() {
78
+ let saturation = this.saturation / 100;
79
+ let brightness = this.brightness / 100;
80
+ let lightness = brightness * (1 - saturation / 2);
81
+ saturation = lightness === 0 || lightness === 1 ? 0 : (brightness - lightness) / Math.min(lightness, 1 - lightness);
82
+ return new HSLColor(toFixedNumber(this.hue, 2), toFixedNumber(saturation * 100, 2), toFixedNumber(lightness * 100, 2), toFixedNumber(this.alpha, 2));
83
+ }
84
+ /**
85
+ * Converts a HSV color value to RGB.
86
+ * Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSV_to_RGB_alternative.
87
+ * @returns An RGBColor object.
88
+ */
89
+ toRGB() {
90
+ let hue = this.hue;
91
+ let saturation = this.saturation / 100;
92
+ let brightness = this.brightness / 100;
93
+ let fn = (n, k = (n + hue / 60) % 6) => brightness - saturation * brightness * Math.max(Math.min(k, 4 - k, 1), 0);
94
+ return new RGBColor(Math.round(fn(5) * 255), Math.round(fn(3) * 255), Math.round(fn(1) * 255), toFixedNumber(this.alpha, 2));
95
+ }
96
+ clone() {
97
+ return new HSBColor(this.hue, this.saturation, this.brightness, this.alpha);
98
+ }
99
+ getChannelFormatOptions(channel) {
100
+ switch (channel) {
101
+ case "hue": return {
102
+ style: "unit",
103
+ unit: "degree",
104
+ unitDisplay: "narrow"
105
+ };
106
+ case "saturation":
107
+ case "brightness":
108
+ case "alpha": return { style: "percent" };
109
+ default: throw new Error("Unknown color channel: " + channel);
110
+ }
111
+ }
112
+ formatChannelValue(channel, locale) {
113
+ let options = this.getChannelFormatOptions(channel);
114
+ let value = this.getChannelValue(channel);
115
+ if (channel === "saturation" || channel === "brightness") value /= 100;
116
+ return new Intl.NumberFormat(locale, options).format(value);
117
+ }
118
+ getChannelRange(channel) {
119
+ switch (channel) {
120
+ case "hue": return {
121
+ minValue: 0,
122
+ maxValue: 360,
123
+ step: 1,
124
+ pageSize: 15
125
+ };
126
+ case "saturation":
127
+ case "brightness": return {
128
+ minValue: 0,
129
+ maxValue: 100,
130
+ step: 1,
131
+ pageSize: 10
132
+ };
133
+ case "alpha": return {
134
+ minValue: 0,
135
+ maxValue: 1,
136
+ step: .01,
137
+ pageSize: .1
138
+ };
139
+ default: throw new Error("Unknown color channel: " + channel);
140
+ }
141
+ }
142
+ toJSON() {
143
+ return {
144
+ h: this.hue,
145
+ s: this.saturation,
146
+ b: this.brightness,
147
+ a: this.alpha
148
+ };
149
+ }
150
+ getFormat() {
151
+ return "hsba";
152
+ }
153
+ getChannels() {
154
+ return HSBColor.colorChannels;
155
+ }
179
156
  };
157
+ _defineProperty(HSBColor, "colorChannels", [
158
+ "hue",
159
+ "saturation",
160
+ "brightness"
161
+ ]);
162
+ export { HSBColor };
@@ -1,36 +1,33 @@
1
- import { Color } from './color.mjs';
2
- import { ColorStringFormat, ColorFormat, ColorType, ColorChannel, ColorChannelRange } from './types.mjs';
3
-
4
- declare const HSL_REGEX: RegExp;
5
- declare class HSLColor extends Color {
6
- private hue;
7
- private saturation;
8
- private lightness;
9
- private alpha;
10
- constructor(hue: number, saturation: number, lightness: number, alpha: number);
11
- static parse(value: string): HSLColor | void;
12
- toString(format?: ColorStringFormat): string;
13
- toFormat(format: ColorFormat): ColorType;
14
- /**
15
- * Converts a HSL color to HSB.
16
- * Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_HSV.
17
- * @returns An HSBColor object.
18
- */
19
- private toHSB;
20
- /**
21
- * Converts a HSL color to RGB.
22
- * Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_RGB_alternative.
23
- * @returns An RGBColor object.
24
- */
25
- private toRGB;
26
- clone(): ColorType;
27
- getChannelFormatOptions(channel: ColorChannel): Intl.NumberFormatOptions;
28
- formatChannelValue(channel: ColorChannel, locale: string): string;
29
- getChannelRange(channel: ColorChannel): ColorChannelRange;
30
- toJSON(): Record<"h" | "s" | "l" | "a", number>;
31
- getFormat(): ColorFormat;
32
- private static colorChannels;
33
- getChannels(): [ColorChannel, ColorChannel, ColorChannel];
34
- }
35
-
36
- export { HSLColor, HSL_REGEX };
1
+ import { Color } from "./color.mjs";
2
+ import { ColorChannel, ColorChannelRange, ColorFormat, ColorStringFormat, ColorType } from "./types.mjs";
3
+ export declare const HSL_REGEX: RegExp;
4
+ export declare class HSLColor extends Color {
5
+ private hue;
6
+ private saturation;
7
+ private lightness;
8
+ private alpha;
9
+ constructor(hue: number, saturation: number, lightness: number, alpha: number);
10
+ static parse(value: string): HSLColor | void;
11
+ toString(format?: ColorStringFormat): string;
12
+ toFormat(format: ColorFormat): ColorType;
13
+ /**
14
+ * Converts a HSL color to HSB.
15
+ * Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_HSV.
16
+ * @returns An HSBColor object.
17
+ */
18
+ private toHSB;
19
+ /**
20
+ * Converts a HSL color to RGB.
21
+ * Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_RGB_alternative.
22
+ * @returns An RGBColor object.
23
+ */
24
+ private toRGB;
25
+ clone(): ColorType;
26
+ getChannelFormatOptions(channel: ColorChannel): Intl.NumberFormatOptions;
27
+ formatChannelValue(channel: ColorChannel, locale: string): string;
28
+ getChannelRange(channel: ColorChannel): ColorChannelRange;
29
+ toJSON(): Record<"h" | "s" | "l" | "a", number>;
30
+ getFormat(): ColorFormat;
31
+ private static colorChannels;
32
+ getChannels(): [ColorChannel, ColorChannel, ColorChannel];
33
+ }
@@ -1,36 +1,33 @@
1
- import { Color } from './color.js';
2
- import { ColorStringFormat, ColorFormat, ColorType, ColorChannel, ColorChannelRange } from './types.js';
3
-
4
- declare const HSL_REGEX: RegExp;
5
- declare class HSLColor extends Color {
6
- private hue;
7
- private saturation;
8
- private lightness;
9
- private alpha;
10
- constructor(hue: number, saturation: number, lightness: number, alpha: number);
11
- static parse(value: string): HSLColor | void;
12
- toString(format?: ColorStringFormat): string;
13
- toFormat(format: ColorFormat): ColorType;
14
- /**
15
- * Converts a HSL color to HSB.
16
- * Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_HSV.
17
- * @returns An HSBColor object.
18
- */
19
- private toHSB;
20
- /**
21
- * Converts a HSL color to RGB.
22
- * Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_RGB_alternative.
23
- * @returns An RGBColor object.
24
- */
25
- private toRGB;
26
- clone(): ColorType;
27
- getChannelFormatOptions(channel: ColorChannel): Intl.NumberFormatOptions;
28
- formatChannelValue(channel: ColorChannel, locale: string): string;
29
- getChannelRange(channel: ColorChannel): ColorChannelRange;
30
- toJSON(): Record<"h" | "s" | "l" | "a", number>;
31
- getFormat(): ColorFormat;
32
- private static colorChannels;
33
- getChannels(): [ColorChannel, ColorChannel, ColorChannel];
34
- }
35
-
36
- export { HSLColor, HSL_REGEX };
1
+ import { Color } from "./color.js";
2
+ import { ColorChannel, ColorChannelRange, ColorFormat, ColorStringFormat, ColorType } from "./types.js";
3
+ export declare const HSL_REGEX: RegExp;
4
+ export declare class HSLColor extends Color {
5
+ private hue;
6
+ private saturation;
7
+ private lightness;
8
+ private alpha;
9
+ constructor(hue: number, saturation: number, lightness: number, alpha: number);
10
+ static parse(value: string): HSLColor | void;
11
+ toString(format?: ColorStringFormat): string;
12
+ toFormat(format: ColorFormat): ColorType;
13
+ /**
14
+ * Converts a HSL color to HSB.
15
+ * Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_HSV.
16
+ * @returns An HSBColor object.
17
+ */
18
+ private toHSB;
19
+ /**
20
+ * Converts a HSL color to RGB.
21
+ * Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_RGB_alternative.
22
+ * @returns An RGBColor object.
23
+ */
24
+ private toRGB;
25
+ clone(): ColorType;
26
+ getChannelFormatOptions(channel: ColorChannel): Intl.NumberFormatOptions;
27
+ formatChannelValue(channel: ColorChannel, locale: string): string;
28
+ getChannelRange(channel: ColorChannel): ColorChannelRange;
29
+ toJSON(): Record<"h" | "s" | "l" | "a", number>;
30
+ getFormat(): ColorFormat;
31
+ private static colorChannels;
32
+ getChannels(): [ColorChannel, ColorChannel, ColorChannel];
33
+ }