@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.
- package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/defineProperty.js +11 -0
- package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/defineProperty.mjs +11 -0
- package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/toPrimitive.js +13 -0
- package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/toPrimitive.mjs +13 -0
- package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/toPropertyKey.js +8 -0
- package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/toPropertyKey.mjs +8 -0
- package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/typeof.js +15 -0
- package/dist/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/typeof.mjs +10 -0
- package/dist/area-gradient.d.mts +9 -11
- package/dist/area-gradient.d.ts +9 -11
- package/dist/area-gradient.js +58 -89
- package/dist/area-gradient.mjs +54 -77
- package/dist/color-format-gradient.d.mts +76 -78
- package/dist/color-format-gradient.d.ts +76 -78
- package/dist/color-format-gradient.js +118 -185
- package/dist/color-format-gradient.mjs +104 -152
- package/dist/color.d.mts +20 -23
- package/dist/color.d.ts +20 -23
- package/dist/color.js +57 -83
- package/dist/color.mjs +53 -60
- package/dist/gamut.d.mts +2 -5
- package/dist/gamut.d.ts +2 -5
- package/dist/gamut.js +12 -34
- package/dist/gamut.mjs +8 -11
- package/dist/hsb-color.d.mts +37 -40
- package/dist/hsb-color.d.ts +37 -40
- package/dist/hsb-color.js +164 -200
- package/dist/hsb-color.mjs +158 -175
- package/dist/hsl-color.d.mts +33 -36
- package/dist/hsl-color.d.ts +33 -36
- package/dist/hsl-color.js +139 -168
- package/dist/hsl-color.mjs +132 -142
- package/dist/index.d.mts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +23 -60
- package/dist/index.mjs +2 -28
- package/dist/native-color.d.mts +1 -3
- package/dist/native-color.d.ts +1 -3
- package/dist/native-color.js +16 -39
- package/dist/native-color.mjs +12 -16
- package/dist/oklab-color.d.mts +57 -60
- package/dist/oklab-color.d.ts +57 -60
- package/dist/oklab-color.js +363 -379
- package/dist/oklab-color.mjs +353 -350
- package/dist/oklab-math.d.mts +26 -28
- package/dist/oklab-math.d.ts +26 -28
- package/dist/oklab-math.js +123 -142
- package/dist/oklab-math.mjs +108 -108
- package/dist/parse-color.d.mts +3 -6
- package/dist/parse-color.d.ts +3 -6
- package/dist/parse-color.js +22 -48
- package/dist/parse-color.mjs +13 -20
- package/dist/rgb-color.d.mts +33 -36
- package/dist/rgb-color.d.ts +33 -36
- package/dist/rgb-color.js +182 -220
- package/dist/rgb-color.mjs +174 -193
- package/dist/types.d.mts +82 -84
- package/dist/types.d.ts +82 -84
- package/dist/types.js +4 -18
- package/dist/types.mjs +1 -0
- package/package.json +3 -3
- package/dist/chunk-QZ7TP4HQ.mjs +0 -7
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const require_toPropertyKey = require("./toPropertyKey.js");
|
|
2
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/defineProperty.js
|
|
3
|
+
function _defineProperty(e, r, t) {
|
|
4
|
+
return (r = require_toPropertyKey.default(r)) in e ? Object.defineProperty(e, r, {
|
|
5
|
+
value: t,
|
|
6
|
+
enumerable: !0,
|
|
7
|
+
configurable: !0,
|
|
8
|
+
writable: !0
|
|
9
|
+
}) : e[r] = t, e;
|
|
10
|
+
}
|
|
11
|
+
exports.default = _defineProperty;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import toPropertyKey from "./toPropertyKey.mjs";
|
|
2
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/defineProperty.js
|
|
3
|
+
function _defineProperty(e, r, t) {
|
|
4
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
5
|
+
value: t,
|
|
6
|
+
enumerable: !0,
|
|
7
|
+
configurable: !0,
|
|
8
|
+
writable: !0
|
|
9
|
+
}) : e[r] = t, e;
|
|
10
|
+
}
|
|
11
|
+
export { _defineProperty as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_typeof = require("./typeof.js");
|
|
2
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPrimitive.js
|
|
3
|
+
function toPrimitive(t, e) {
|
|
4
|
+
if ("object" != require_typeof.default(t) || !t) return t;
|
|
5
|
+
var r;
|
|
6
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
7
|
+
var i = r.call(t, e || "default");
|
|
8
|
+
if ("object" != require_typeof.default(i)) return i;
|
|
9
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
10
|
+
}
|
|
11
|
+
return ("string" === e ? String : Number)(t);
|
|
12
|
+
}
|
|
13
|
+
exports.default = toPrimitive;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import _typeof from "./typeof.mjs";
|
|
2
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPrimitive.js
|
|
3
|
+
function toPrimitive(t, e) {
|
|
4
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
5
|
+
var r;
|
|
6
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
7
|
+
var i = r.call(t, e || "default");
|
|
8
|
+
if ("object" != _typeof(i)) return i;
|
|
9
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
10
|
+
}
|
|
11
|
+
return ("string" === e ? String : Number)(t);
|
|
12
|
+
}
|
|
13
|
+
export { toPrimitive as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const require_typeof = require("./typeof.js");
|
|
2
|
+
const require_toPrimitive = require("./toPrimitive.js");
|
|
3
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPropertyKey.js
|
|
4
|
+
function toPropertyKey(t) {
|
|
5
|
+
var i = require_toPrimitive.default(t, "string");
|
|
6
|
+
return "symbol" == require_typeof.default(i) ? i : i + "";
|
|
7
|
+
}
|
|
8
|
+
exports.default = toPropertyKey;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _typeof from "./typeof.mjs";
|
|
2
|
+
import toPrimitive from "./toPrimitive.mjs";
|
|
3
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPropertyKey.js
|
|
4
|
+
function toPropertyKey(t) {
|
|
5
|
+
var i = toPrimitive(t, "string");
|
|
6
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
7
|
+
}
|
|
8
|
+
export { toPropertyKey as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/typeof.js
|
|
2
|
+
function _typeof(o) {
|
|
3
|
+
"@babel/helpers - typeof";
|
|
4
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
5
|
+
return typeof o;
|
|
6
|
+
} : function(o) {
|
|
7
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
8
|
+
}, _typeof(o);
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(exports, "default", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function() {
|
|
13
|
+
return _typeof;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/typeof.js
|
|
2
|
+
function _typeof(o) {
|
|
3
|
+
"@babel/helpers - typeof";
|
|
4
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
5
|
+
return typeof o;
|
|
6
|
+
} : function(o) {
|
|
7
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
8
|
+
}, _typeof(o);
|
|
9
|
+
}
|
|
10
|
+
export { _typeof as default };
|
package/dist/area-gradient.d.mts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { Color } from
|
|
2
|
-
import { ColorChannel } from
|
|
3
|
-
|
|
1
|
+
import { Color } from "./color.mjs";
|
|
2
|
+
import { ColorChannel } from "./types.mjs";
|
|
4
3
|
interface GradientOptions {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
xChannel: ColorChannel;
|
|
5
|
+
yChannel: ColorChannel;
|
|
6
|
+
dir?: "rtl" | "ltr" | undefined;
|
|
8
7
|
}
|
|
9
8
|
interface GradientStyles {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
areaStyles: Record<string, string>;
|
|
10
|
+
areaGradientStyles: Record<string, string>;
|
|
12
11
|
}
|
|
13
|
-
declare function getColorAreaGradient(color: Color, options: GradientOptions): GradientStyles;
|
|
14
|
-
|
|
15
|
-
export { getColorAreaGradient };
|
|
12
|
+
export declare function getColorAreaGradient(color: Color, options: GradientOptions): GradientStyles;
|
|
13
|
+
export {};
|
package/dist/area-gradient.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { Color } from
|
|
2
|
-
import { ColorChannel } from
|
|
3
|
-
|
|
1
|
+
import { Color } from "./color.js";
|
|
2
|
+
import { ColorChannel } from "./types.js";
|
|
4
3
|
interface GradientOptions {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
xChannel: ColorChannel;
|
|
5
|
+
yChannel: ColorChannel;
|
|
6
|
+
dir?: "rtl" | "ltr" | undefined;
|
|
8
7
|
}
|
|
9
8
|
interface GradientStyles {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
areaStyles: Record<string, string>;
|
|
10
|
+
areaGradientStyles: Record<string, string>;
|
|
12
11
|
}
|
|
13
|
-
declare function getColorAreaGradient(color: Color, options: GradientOptions): GradientStyles;
|
|
14
|
-
|
|
15
|
-
export { getColorAreaGradient };
|
|
12
|
+
export declare function getColorAreaGradient(color: Color, options: GradientOptions): GradientStyles;
|
|
13
|
+
export {};
|
package/dist/area-gradient.js
CHANGED
|
@@ -1,92 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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/area-gradient.ts
|
|
21
|
-
var area_gradient_exports = {};
|
|
22
|
-
__export(area_gradient_exports, {
|
|
23
|
-
getColorAreaGradient: () => getColorAreaGradient
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
24
4
|
});
|
|
25
|
-
|
|
26
|
-
|
|
5
|
+
const require_color_format_gradient = require("./color-format-gradient.js");
|
|
6
|
+
// src/area-gradient.ts
|
|
27
7
|
function getColorAreaGradient(color, options) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
dir = xChannel === "hue";
|
|
83
|
-
background = (0, import_color_format_gradient.generateHSL_L)(orientation, dir, zValue);
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return background;
|
|
8
|
+
const { xChannel, yChannel, dir: dirProp = "ltr" } = options;
|
|
9
|
+
const { zChannel } = color.getColorAxes({
|
|
10
|
+
xChannel,
|
|
11
|
+
yChannel
|
|
12
|
+
});
|
|
13
|
+
const zValue = color.getChannelValue(zChannel);
|
|
14
|
+
const { minValue: zMin, maxValue: zMax } = color.getChannelRange(zChannel);
|
|
15
|
+
const orientation = ["top", dirProp === "rtl" ? "left" : "right"];
|
|
16
|
+
let dir = false;
|
|
17
|
+
let background = {
|
|
18
|
+
areaStyles: {},
|
|
19
|
+
areaGradientStyles: {}
|
|
20
|
+
};
|
|
21
|
+
let alphaValue = (zValue - zMin) / (zMax - zMin);
|
|
22
|
+
let isHSL = color.getFormat() === "hsla";
|
|
23
|
+
switch (zChannel) {
|
|
24
|
+
case "red":
|
|
25
|
+
dir = xChannel === "green";
|
|
26
|
+
background = require_color_format_gradient.generateRGB_R(orientation, dir, zValue);
|
|
27
|
+
break;
|
|
28
|
+
case "green":
|
|
29
|
+
dir = xChannel === "red";
|
|
30
|
+
background = require_color_format_gradient.generateRGB_G(orientation, dir, zValue);
|
|
31
|
+
break;
|
|
32
|
+
case "blue":
|
|
33
|
+
dir = xChannel === "red";
|
|
34
|
+
background = require_color_format_gradient.generateRGB_B(orientation, dir, zValue);
|
|
35
|
+
break;
|
|
36
|
+
case "hue":
|
|
37
|
+
dir = xChannel !== "saturation";
|
|
38
|
+
if (isHSL) background = require_color_format_gradient.generateHSL_H(orientation, dir, zValue);
|
|
39
|
+
else background = require_color_format_gradient.generateHSB_H(orientation, dir, zValue);
|
|
40
|
+
break;
|
|
41
|
+
case "saturation":
|
|
42
|
+
dir = xChannel === "hue";
|
|
43
|
+
if (isHSL) background = require_color_format_gradient.generateHSL_S(orientation, dir, alphaValue);
|
|
44
|
+
else background = require_color_format_gradient.generateHSB_S(orientation, dir, alphaValue);
|
|
45
|
+
break;
|
|
46
|
+
case "brightness":
|
|
47
|
+
dir = xChannel === "hue";
|
|
48
|
+
background = require_color_format_gradient.generateHSB_B(orientation, dir, alphaValue);
|
|
49
|
+
break;
|
|
50
|
+
case "lightness":
|
|
51
|
+
if (color.getFormat() === "oklab") {
|
|
52
|
+
dir = xChannel === "b";
|
|
53
|
+
background = require_color_format_gradient.generateOKLAB_AB(orientation, dir, zValue);
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
dir = xChannel === "hue";
|
|
57
|
+
background = require_color_format_gradient.generateHSL_L(orientation, dir, zValue);
|
|
58
|
+
}
|
|
59
|
+
return background;
|
|
88
60
|
}
|
|
89
|
-
|
|
90
|
-
0 && (module.exports = {
|
|
91
|
-
getColorAreaGradient
|
|
92
|
-
});
|
|
61
|
+
exports.getColorAreaGradient = getColorAreaGradient;
|
package/dist/area-gradient.mjs
CHANGED
|
@@ -1,80 +1,57 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
|
|
1
|
+
import { generateHSB_B, generateHSB_H, generateHSB_S, generateHSL_H, generateHSL_L, generateHSL_S, generateOKLAB_AB, generateRGB_B, generateRGB_G, generateRGB_R } from "./color-format-gradient.mjs";
|
|
3
2
|
// src/area-gradient.ts
|
|
4
|
-
import {
|
|
5
|
-
generateRGB_R,
|
|
6
|
-
generateRGB_G,
|
|
7
|
-
generateRGB_B,
|
|
8
|
-
generateHSL_H,
|
|
9
|
-
generateHSB_H,
|
|
10
|
-
generateHSL_S,
|
|
11
|
-
generateHSB_S,
|
|
12
|
-
generateHSB_B,
|
|
13
|
-
generateHSL_L,
|
|
14
|
-
generateOKLAB_AB
|
|
15
|
-
} from "./color-format-gradient.mjs";
|
|
16
3
|
function getColorAreaGradient(color, options) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
dir = xChannel === "hue";
|
|
72
|
-
background = generateHSL_L(orientation, dir, zValue);
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return background;
|
|
4
|
+
const { xChannel, yChannel, dir: dirProp = "ltr" } = options;
|
|
5
|
+
const { zChannel } = color.getColorAxes({
|
|
6
|
+
xChannel,
|
|
7
|
+
yChannel
|
|
8
|
+
});
|
|
9
|
+
const zValue = color.getChannelValue(zChannel);
|
|
10
|
+
const { minValue: zMin, maxValue: zMax } = color.getChannelRange(zChannel);
|
|
11
|
+
const orientation = ["top", dirProp === "rtl" ? "left" : "right"];
|
|
12
|
+
let dir = false;
|
|
13
|
+
let background = {
|
|
14
|
+
areaStyles: {},
|
|
15
|
+
areaGradientStyles: {}
|
|
16
|
+
};
|
|
17
|
+
let alphaValue = (zValue - zMin) / (zMax - zMin);
|
|
18
|
+
let isHSL = color.getFormat() === "hsla";
|
|
19
|
+
switch (zChannel) {
|
|
20
|
+
case "red":
|
|
21
|
+
dir = xChannel === "green";
|
|
22
|
+
background = generateRGB_R(orientation, dir, zValue);
|
|
23
|
+
break;
|
|
24
|
+
case "green":
|
|
25
|
+
dir = xChannel === "red";
|
|
26
|
+
background = generateRGB_G(orientation, dir, zValue);
|
|
27
|
+
break;
|
|
28
|
+
case "blue":
|
|
29
|
+
dir = xChannel === "red";
|
|
30
|
+
background = generateRGB_B(orientation, dir, zValue);
|
|
31
|
+
break;
|
|
32
|
+
case "hue":
|
|
33
|
+
dir = xChannel !== "saturation";
|
|
34
|
+
if (isHSL) background = generateHSL_H(orientation, dir, zValue);
|
|
35
|
+
else background = generateHSB_H(orientation, dir, zValue);
|
|
36
|
+
break;
|
|
37
|
+
case "saturation":
|
|
38
|
+
dir = xChannel === "hue";
|
|
39
|
+
if (isHSL) background = generateHSL_S(orientation, dir, alphaValue);
|
|
40
|
+
else background = generateHSB_S(orientation, dir, alphaValue);
|
|
41
|
+
break;
|
|
42
|
+
case "brightness":
|
|
43
|
+
dir = xChannel === "hue";
|
|
44
|
+
background = generateHSB_B(orientation, dir, alphaValue);
|
|
45
|
+
break;
|
|
46
|
+
case "lightness":
|
|
47
|
+
if (color.getFormat() === "oklab") {
|
|
48
|
+
dir = xChannel === "b";
|
|
49
|
+
background = generateOKLAB_AB(orientation, dir, zValue);
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
dir = xChannel === "hue";
|
|
53
|
+
background = generateHSL_L(orientation, dir, zValue);
|
|
54
|
+
}
|
|
55
|
+
return background;
|
|
77
56
|
}
|
|
78
|
-
export {
|
|
79
|
-
getColorAreaGradient
|
|
80
|
-
};
|
|
57
|
+
export { getColorAreaGradient };
|
|
@@ -1,90 +1,88 @@
|
|
|
1
|
-
declare const generateRGB_R: (orientation: [string, string], dir: boolean, zValue: number) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
+
};
|