@zag-js/color-utils 2.0.0-next.3 → 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,90 +1,88 @@
1
- declare const generateRGB_R: (orientation: [string, string], dir: boolean, zValue: number) => {
2
- areaStyles: {
3
- backgroundImage: string;
4
- };
5
- areaGradientStyles: {
6
- backgroundImage: string;
7
- WebkitMaskImage: string;
8
- maskImage: string;
9
- };
1
+ export declare const generateRGB_R: (orientation: [string, string], dir: boolean, zValue: number) => {
2
+ areaStyles: {
3
+ backgroundImage: string;
4
+ };
5
+ areaGradientStyles: {
6
+ backgroundImage: string;
7
+ WebkitMaskImage: string;
8
+ maskImage: string;
9
+ };
10
10
  };
11
- declare const generateRGB_G: (orientation: [string, string], dir: boolean, zValue: number) => {
12
- areaStyles: {
13
- backgroundImage: string;
14
- };
15
- areaGradientStyles: {
16
- backgroundImage: string;
17
- WebkitMaskImage: string;
18
- maskImage: string;
19
- };
11
+ export declare const generateRGB_G: (orientation: [string, string], dir: boolean, zValue: number) => {
12
+ areaStyles: {
13
+ backgroundImage: string;
14
+ };
15
+ areaGradientStyles: {
16
+ backgroundImage: string;
17
+ WebkitMaskImage: string;
18
+ maskImage: string;
19
+ };
20
20
  };
21
- declare const generateRGB_B: (orientation: [string, string], dir: boolean, zValue: number) => {
22
- areaStyles: {
23
- backgroundImage: string;
24
- };
25
- areaGradientStyles: {
26
- backgroundImage: string;
27
- WebkitMaskImage: string;
28
- maskImage: string;
29
- };
21
+ export declare const generateRGB_B: (orientation: [string, string], dir: boolean, zValue: number) => {
22
+ areaStyles: {
23
+ backgroundImage: string;
24
+ };
25
+ areaGradientStyles: {
26
+ backgroundImage: string;
27
+ WebkitMaskImage: string;
28
+ maskImage: string;
29
+ };
30
30
  };
31
- declare const generateHSL_H: (orientation: [string, string], dir: boolean, zValue: number) => {
32
- areaStyles: {};
33
- areaGradientStyles: {
34
- background: string;
35
- };
31
+ export declare const generateHSL_H: (orientation: [string, string], dir: boolean, zValue: number) => {
32
+ areaStyles: {};
33
+ areaGradientStyles: {
34
+ background: string;
35
+ };
36
36
  };
37
- declare const generateHSL_S: (orientation: [string, string], dir: boolean, alphaValue: number) => {
38
- areaStyles: {};
39
- areaGradientStyles: {
40
- background: string;
41
- };
37
+ export declare const generateHSL_S: (orientation: [string, string], dir: boolean, alphaValue: number) => {
38
+ areaStyles: {};
39
+ areaGradientStyles: {
40
+ background: string;
41
+ };
42
42
  };
43
- declare const generateHSL_L: (orientation: [string, string], dir: boolean, zValue: number) => {
44
- areaStyles: {};
45
- areaGradientStyles: {
46
- backgroundImage: string;
47
- };
43
+ export declare const generateHSL_L: (orientation: [string, string], dir: boolean, zValue: number) => {
44
+ areaStyles: {};
45
+ areaGradientStyles: {
46
+ backgroundImage: string;
47
+ };
48
48
  };
49
- declare const generateHSB_H: (orientation: [string, string], dir: boolean, zValue: number) => {
50
- areaStyles: {};
51
- areaGradientStyles: {
52
- background: string;
53
- };
49
+ export declare const generateHSB_H: (orientation: [string, string], dir: boolean, zValue: number) => {
50
+ areaStyles: {};
51
+ areaGradientStyles: {
52
+ background: string;
53
+ };
54
54
  };
55
- declare const generateHSB_S: (orientation: [string, string], dir: boolean, alphaValue: number) => {
56
- areaStyles: {};
57
- areaGradientStyles: {
58
- background: string;
59
- };
55
+ export declare const generateHSB_S: (orientation: [string, string], dir: boolean, alphaValue: number) => {
56
+ areaStyles: {};
57
+ areaGradientStyles: {
58
+ background: string;
59
+ };
60
60
  };
61
- declare const generateHSB_B: (orientation: [string, string], dir: boolean, alphaValue: number) => {
62
- areaStyles: {};
63
- areaGradientStyles: {
64
- background: string;
65
- };
61
+ export declare const generateHSB_B: (orientation: [string, string], dir: boolean, alphaValue: number) => {
62
+ areaStyles: {};
63
+ areaGradientStyles: {
64
+ background: string;
65
+ };
66
66
  };
67
67
  /** oklab: x = a, y = b, z = lightness (fixed L) */
68
- declare const generateOKLAB_AB: (orientation: [string, string], dir: boolean, L: number) => {
69
- areaStyles: {
70
- background: string;
71
- };
72
- areaGradientStyles: {
73
- background: string;
74
- maskImage: string;
75
- WebkitMaskImage: string;
76
- };
68
+ export declare const generateOKLAB_AB: (orientation: [string, string], dir: boolean, L: number) => {
69
+ areaStyles: {
70
+ background: string;
71
+ };
72
+ areaGradientStyles: {
73
+ background: string;
74
+ maskImage: string;
75
+ WebkitMaskImage: string;
76
+ };
77
77
  };
78
78
  /** oklch: x = lightness, y = chroma, z = hue (fixed H) */
79
- declare const generateOKLCH_LC: (orientation: [string, string], dir: boolean, H: number) => {
80
- areaStyles: {
81
- background: string;
82
- };
83
- areaGradientStyles: {
84
- background: string;
85
- maskImage: string;
86
- WebkitMaskImage: string;
87
- };
88
- };
89
-
90
- export { generateHSB_B, generateHSB_H, generateHSB_S, generateHSL_H, generateHSL_L, generateHSL_S, generateOKLAB_AB, generateOKLCH_LC, generateRGB_B, generateRGB_G, generateRGB_R };
79
+ export declare const generateOKLCH_LC: (orientation: [string, string], dir: boolean, H: number) => {
80
+ areaStyles: {
81
+ background: string;
82
+ };
83
+ areaGradientStyles: {
84
+ background: string;
85
+ maskImage: string;
86
+ WebkitMaskImage: string;
87
+ };
88
+ };
@@ -1,197 +1,130 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/color-format-gradient.ts
21
- var color_format_gradient_exports = {};
22
- __export(color_format_gradient_exports, {
23
- generateHSB_B: () => generateHSB_B,
24
- generateHSB_H: () => generateHSB_H,
25
- generateHSB_S: () => generateHSB_S,
26
- generateHSL_H: () => generateHSL_H,
27
- generateHSL_L: () => generateHSL_L,
28
- generateHSL_S: () => generateHSL_S,
29
- generateOKLAB_AB: () => generateOKLAB_AB,
30
- generateOKLCH_LC: () => generateOKLCH_LC,
31
- generateRGB_B: () => generateRGB_B,
32
- generateRGB_G: () => generateRGB_G,
33
- generateRGB_R: () => generateRGB_R
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
34
4
  });
35
- module.exports = __toCommonJS(color_format_gradient_exports);
36
- var generateRGB_R = (orientation, dir, zValue) => {
37
- const maskImage = `linear-gradient(to ${orientation[Number(!dir)]}, transparent, #000)`;
38
- const result = {
39
- areaStyles: {
40
- backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(${zValue},0,0),rgb(${zValue},255,0))`
41
- },
42
- areaGradientStyles: {
43
- backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(${zValue},0,255),rgb(${zValue},255,255))`,
44
- WebkitMaskImage: maskImage,
45
- maskImage
46
- }
47
- };
48
- return result;
5
+ // src/color-format-gradient.ts
6
+ const generateRGB_R = (orientation, dir, zValue) => {
7
+ const maskImage = `linear-gradient(to ${orientation[Number(!dir)]}, transparent, #000)`;
8
+ return {
9
+ areaStyles: { backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(${zValue},0,0),rgb(${zValue},255,0))` },
10
+ areaGradientStyles: {
11
+ backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(${zValue},0,255),rgb(${zValue},255,255))`,
12
+ WebkitMaskImage: maskImage,
13
+ maskImage
14
+ }
15
+ };
49
16
  };
50
- var generateRGB_G = (orientation, dir, zValue) => {
51
- const maskImage = `linear-gradient(to ${orientation[Number(!dir)]}, transparent, #000)`;
52
- const result = {
53
- areaStyles: {
54
- backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,${zValue},0),rgb(255,${zValue},0))`
55
- },
56
- areaGradientStyles: {
57
- backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,${zValue},255),rgb(255,${zValue},255))`,
58
- WebkitMaskImage: maskImage,
59
- maskImage
60
- }
61
- };
62
- return result;
17
+ const generateRGB_G = (orientation, dir, zValue) => {
18
+ const maskImage = `linear-gradient(to ${orientation[Number(!dir)]}, transparent, #000)`;
19
+ return {
20
+ areaStyles: { backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,${zValue},0),rgb(255,${zValue},0))` },
21
+ areaGradientStyles: {
22
+ backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,${zValue},255),rgb(255,${zValue},255))`,
23
+ WebkitMaskImage: maskImage,
24
+ maskImage
25
+ }
26
+ };
63
27
  };
64
- var generateRGB_B = (orientation, dir, zValue) => {
65
- const maskImage = `linear-gradient(to ${orientation[Number(!dir)]}, transparent, #000)`;
66
- const result = {
67
- areaStyles: {
68
- backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,0,${zValue}),rgb(255,0,${zValue}))`
69
- },
70
- areaGradientStyles: {
71
- backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,255,${zValue}),rgb(255,255,${zValue}))`,
72
- WebkitMaskImage: maskImage,
73
- maskImage
74
- }
75
- };
76
- return result;
28
+ const generateRGB_B = (orientation, dir, zValue) => {
29
+ const maskImage = `linear-gradient(to ${orientation[Number(!dir)]}, transparent, #000)`;
30
+ return {
31
+ areaStyles: { backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,0,${zValue}),rgb(255,0,${zValue}))` },
32
+ areaGradientStyles: {
33
+ backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,255,${zValue}),rgb(255,255,${zValue}))`,
34
+ WebkitMaskImage: maskImage,
35
+ maskImage
36
+ }
37
+ };
77
38
  };
78
- var generateHSL_H = (orientation, dir, zValue) => {
79
- const result = {
80
- areaStyles: {},
81
- areaGradientStyles: {
82
- background: [
83
- `linear-gradient(to ${orientation[Number(dir)]}, hsla(0,0%,0%,1) 0%, hsla(0,0%,0%,0) 50%, hsla(0,0%,100%,0) 50%, hsla(0,0%,100%,1) 100%)`,
84
- `linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,50%),hsla(0,0%,50%,0))`,
85
- `hsl(${zValue}, 100%, 50%)`
86
- ].join(",")
87
- }
88
- };
89
- return result;
39
+ const generateHSL_H = (orientation, dir, zValue) => {
40
+ return {
41
+ areaStyles: {},
42
+ areaGradientStyles: { background: [
43
+ `linear-gradient(to ${orientation[Number(dir)]}, hsla(0,0%,0%,1) 0%, hsla(0,0%,0%,0) 50%, hsla(0,0%,100%,0) 50%, hsla(0,0%,100%,1) 100%)`,
44
+ `linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,50%),hsla(0,0%,50%,0))`,
45
+ `hsl(${zValue}, 100%, 50%)`
46
+ ].join(",") }
47
+ };
90
48
  };
91
- var generateHSL_S = (orientation, dir, alphaValue) => {
92
- const result = {
93
- areaStyles: {},
94
- areaGradientStyles: {
95
- background: [
96
- `linear-gradient(to ${orientation[Number(!dir)]}, hsla(0,0%,0%,${alphaValue}) 0%, hsla(0,0%,0%,0) 50%, hsla(0,0%,100%,0) 50%, hsla(0,0%,100%,${alphaValue}) 100%)`,
97
- `linear-gradient(to ${orientation[Number(dir)]},hsla(0,100%,50%,${alphaValue}),hsla(60,100%,50%,${alphaValue}),hsla(120,100%,50%,${alphaValue}),hsla(180,100%,50%,${alphaValue}),hsla(240,100%,50%,${alphaValue}),hsla(300,100%,50%,${alphaValue}),hsla(359,100%,50%,${alphaValue}))`,
98
- "hsl(0, 0%, 50%)"
99
- ].join(",")
100
- }
101
- };
102
- return result;
49
+ const generateHSL_S = (orientation, dir, alphaValue) => {
50
+ return {
51
+ areaStyles: {},
52
+ areaGradientStyles: { background: [
53
+ `linear-gradient(to ${orientation[Number(!dir)]}, hsla(0,0%,0%,${alphaValue}) 0%, hsla(0,0%,0%,0) 50%, hsla(0,0%,100%,0) 50%, hsla(0,0%,100%,${alphaValue}) 100%)`,
54
+ `linear-gradient(to ${orientation[Number(dir)]},hsla(0,100%,50%,${alphaValue}),hsla(60,100%,50%,${alphaValue}),hsla(120,100%,50%,${alphaValue}),hsla(180,100%,50%,${alphaValue}),hsla(240,100%,50%,${alphaValue}),hsla(300,100%,50%,${alphaValue}),hsla(359,100%,50%,${alphaValue}))`,
55
+ "hsl(0, 0%, 50%)"
56
+ ].join(",") }
57
+ };
103
58
  };
104
- var generateHSL_L = (orientation, dir, zValue) => {
105
- const result = {
106
- areaStyles: {},
107
- areaGradientStyles: {
108
- backgroundImage: [
109
- `linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,${zValue}%),hsla(0,0%,${zValue}%,0))`,
110
- `linear-gradient(to ${orientation[Number(dir)]},hsl(0,100%,${zValue}%),hsl(60,100%,${zValue}%),hsl(120,100%,${zValue}%),hsl(180,100%,${zValue}%),hsl(240,100%,${zValue}%),hsl(300,100%,${zValue}%),hsl(360,100%,${zValue}%))`
111
- ].join(",")
112
- }
113
- };
114
- return result;
59
+ const generateHSL_L = (orientation, dir, zValue) => {
60
+ return {
61
+ areaStyles: {},
62
+ areaGradientStyles: { backgroundImage: [`linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,${zValue}%),hsla(0,0%,${zValue}%,0))`, `linear-gradient(to ${orientation[Number(dir)]},hsl(0,100%,${zValue}%),hsl(60,100%,${zValue}%),hsl(120,100%,${zValue}%),hsl(180,100%,${zValue}%),hsl(240,100%,${zValue}%),hsl(300,100%,${zValue}%),hsl(360,100%,${zValue}%))`].join(",") }
63
+ };
115
64
  };
116
- var generateHSB_H = (orientation, dir, zValue) => {
117
- const result = {
118
- areaStyles: {},
119
- areaGradientStyles: {
120
- background: [
121
- `linear-gradient(to ${orientation[Number(dir)]},hsl(0,0%,0%),hsla(0,0%,0%,0))`,
122
- `linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,100%),hsla(0,0%,100%,0))`,
123
- `hsl(${zValue}, 100%, 50%)`
124
- ].join(",")
125
- }
126
- };
127
- return result;
65
+ const generateHSB_H = (orientation, dir, zValue) => {
66
+ return {
67
+ areaStyles: {},
68
+ areaGradientStyles: { background: [
69
+ `linear-gradient(to ${orientation[Number(dir)]},hsl(0,0%,0%),hsla(0,0%,0%,0))`,
70
+ `linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,100%),hsla(0,0%,100%,0))`,
71
+ `hsl(${zValue}, 100%, 50%)`
72
+ ].join(",") }
73
+ };
128
74
  };
129
- var generateHSB_S = (orientation, dir, alphaValue) => {
130
- const result = {
131
- areaStyles: {},
132
- areaGradientStyles: {
133
- background: [
134
- `linear-gradient(to ${orientation[Number(!dir)]},hsla(0,0%,0%,${alphaValue}),hsla(0,0%,0%,0))`,
135
- `linear-gradient(to ${orientation[Number(dir)]},hsla(0,100%,50%,${alphaValue}),hsla(60,100%,50%,${alphaValue}),hsla(120,100%,50%,${alphaValue}),hsla(180,100%,50%,${alphaValue}),hsla(240,100%,50%,${alphaValue}),hsla(300,100%,50%,${alphaValue}),hsla(359,100%,50%,${alphaValue}))`,
136
- `linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,0%),hsl(0,0%,100%))`
137
- ].join(",")
138
- }
139
- };
140
- return result;
75
+ const generateHSB_S = (orientation, dir, alphaValue) => {
76
+ return {
77
+ areaStyles: {},
78
+ areaGradientStyles: { background: [
79
+ `linear-gradient(to ${orientation[Number(!dir)]},hsla(0,0%,0%,${alphaValue}),hsla(0,0%,0%,0))`,
80
+ `linear-gradient(to ${orientation[Number(dir)]},hsla(0,100%,50%,${alphaValue}),hsla(60,100%,50%,${alphaValue}),hsla(120,100%,50%,${alphaValue}),hsla(180,100%,50%,${alphaValue}),hsla(240,100%,50%,${alphaValue}),hsla(300,100%,50%,${alphaValue}),hsla(359,100%,50%,${alphaValue}))`,
81
+ `linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,0%),hsl(0,0%,100%))`
82
+ ].join(",") }
83
+ };
141
84
  };
142
- var generateHSB_B = (orientation, dir, alphaValue) => {
143
- const result = {
144
- areaStyles: {},
145
- areaGradientStyles: {
146
- background: [
147
- `linear-gradient(to ${orientation[Number(!dir)]},hsla(0,0%,100%,${alphaValue}),hsla(0,0%,100%,0))`,
148
- `linear-gradient(to ${orientation[Number(dir)]},hsla(0,100%,50%,${alphaValue}),hsla(60,100%,50%,${alphaValue}),hsla(120,100%,50%,${alphaValue}),hsla(180,100%,50%,${alphaValue}),hsla(240,100%,50%,${alphaValue}),hsla(300,100%,50%,${alphaValue}),hsla(359,100%,50%,${alphaValue}))`,
149
- "#000"
150
- ].join(",")
151
- }
152
- };
153
- return result;
85
+ const generateHSB_B = (orientation, dir, alphaValue) => {
86
+ return {
87
+ areaStyles: {},
88
+ areaGradientStyles: { background: [
89
+ `linear-gradient(to ${orientation[Number(!dir)]},hsla(0,0%,100%,${alphaValue}),hsla(0,0%,100%,0))`,
90
+ `linear-gradient(to ${orientation[Number(dir)]},hsla(0,100%,50%,${alphaValue}),hsla(60,100%,50%,${alphaValue}),hsla(120,100%,50%,${alphaValue}),hsla(180,100%,50%,${alphaValue}),hsla(240,100%,50%,${alphaValue}),hsla(300,100%,50%,${alphaValue}),hsla(359,100%,50%,${alphaValue}))`,
91
+ "#000"
92
+ ].join(",") }
93
+ };
154
94
  };
155
- var generateOKLAB_AB = (orientation, dir, L) => {
156
- const l = L === 0 ? "none" : `${(L * 100).toFixed(2)}%`;
157
- const maskImage = `linear-gradient(to ${orientation[Number(!dir)]}, black, transparent)`;
158
- const result = {
159
- areaStyles: {
160
- background: `linear-gradient(to ${orientation[Number(dir)]} in oklab, oklab(${l} -100% 100%), oklab(${l} 100% 100%))`
161
- },
162
- areaGradientStyles: {
163
- background: `linear-gradient(to ${orientation[Number(dir)]} in oklab, oklab(${l} -100% -100%), oklab(${l} 100% -100%))`,
164
- maskImage,
165
- WebkitMaskImage: maskImage
166
- }
167
- };
168
- return result;
95
+ /** oklab: x = a, y = b, z = lightness (fixed L) */
96
+ const generateOKLAB_AB = (orientation, dir, L) => {
97
+ const l = L === 0 ? "none" : `${(L * 100).toFixed(2)}%`;
98
+ const maskImage = `linear-gradient(to ${orientation[Number(!dir)]}, black, transparent)`;
99
+ return {
100
+ areaStyles: { background: `linear-gradient(to ${orientation[Number(dir)]} in oklab, oklab(${l} -100% 100%), oklab(${l} 100% 100%))` },
101
+ areaGradientStyles: {
102
+ background: `linear-gradient(to ${orientation[Number(dir)]} in oklab, oklab(${l} -100% -100%), oklab(${l} 100% -100%))`,
103
+ maskImage,
104
+ WebkitMaskImage: maskImage
105
+ }
106
+ };
169
107
  };
170
- var generateOKLCH_LC = (orientation, dir, H) => {
171
- const maskImage = `linear-gradient(to ${orientation[Number(dir)]}, transparent, black)`;
172
- const result = {
173
- areaStyles: {
174
- background: `linear-gradient(to ${orientation[Number(!dir)]} in oklch, oklch(0 0.001 ${H}), oklch(1 0.001 ${H}))`
175
- },
176
- areaGradientStyles: {
177
- background: `linear-gradient(to ${orientation[Number(!dir)]} in oklch, oklch(0 0.5 ${H}), oklch(1 0.5 ${H}))`,
178
- maskImage,
179
- WebkitMaskImage: maskImage
180
- }
181
- };
182
- return result;
108
+ /** oklch: x = lightness, y = chroma, z = hue (fixed H) */
109
+ const generateOKLCH_LC = (orientation, dir, H) => {
110
+ const maskImage = `linear-gradient(to ${orientation[Number(dir)]}, transparent, black)`;
111
+ return {
112
+ areaStyles: { background: `linear-gradient(to ${orientation[Number(!dir)]} in oklch, oklch(0 0.001 ${H}), oklch(1 0.001 ${H}))` },
113
+ areaGradientStyles: {
114
+ background: `linear-gradient(to ${orientation[Number(!dir)]} in oklch, oklch(0 0.5 ${H}), oklch(1 0.5 ${H}))`,
115
+ maskImage,
116
+ WebkitMaskImage: maskImage
117
+ }
118
+ };
183
119
  };
184
- // Annotate the CommonJS export names for ESM import in node:
185
- 0 && (module.exports = {
186
- generateHSB_B,
187
- generateHSB_H,
188
- generateHSB_S,
189
- generateHSL_H,
190
- generateHSL_L,
191
- generateHSL_S,
192
- generateOKLAB_AB,
193
- generateOKLCH_LC,
194
- generateRGB_B,
195
- generateRGB_G,
196
- generateRGB_R
197
- });
120
+ exports.generateHSB_B = generateHSB_B;
121
+ exports.generateHSB_H = generateHSB_H;
122
+ exports.generateHSB_S = generateHSB_S;
123
+ exports.generateHSL_H = generateHSL_H;
124
+ exports.generateHSL_L = generateHSL_L;
125
+ exports.generateHSL_S = generateHSL_S;
126
+ exports.generateOKLAB_AB = generateOKLAB_AB;
127
+ exports.generateOKLCH_LC = generateOKLCH_LC;
128
+ exports.generateRGB_B = generateRGB_B;
129
+ exports.generateRGB_G = generateRGB_G;
130
+ exports.generateRGB_R = generateRGB_R;