tinte
Version:
Beautiful editor themes with the best DX - install themes instantly to VS Code, Cursor, and Zed
1,730 lines (1,681 loc) • 164 kB
JavaScript
#!/usr/bin/env node
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __esm = (fn5, res) => function __init() {
return fn5 && (res = (0, fn5[__getOwnPropNames(fn5)[0]])(fn5 = 0)), res;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// ../node_modules/culori/src/rgb/parseNumber.js
var parseNumber, parseNumber_default;
var init_parseNumber = __esm({
"../node_modules/culori/src/rgb/parseNumber.js"() {
"use strict";
parseNumber = (color, len) => {
if (typeof color !== "number") return;
if (len === 3) {
return {
mode: "rgb",
r: (color >> 8 & 15 | color >> 4 & 240) / 255,
g: (color >> 4 & 15 | color & 240) / 255,
b: (color & 15 | color << 4 & 240) / 255
};
}
if (len === 4) {
return {
mode: "rgb",
r: (color >> 12 & 15 | color >> 8 & 240) / 255,
g: (color >> 8 & 15 | color >> 4 & 240) / 255,
b: (color >> 4 & 15 | color & 240) / 255,
alpha: (color & 15 | color << 4 & 240) / 255
};
}
if (len === 6) {
return {
mode: "rgb",
r: (color >> 16 & 255) / 255,
g: (color >> 8 & 255) / 255,
b: (color & 255) / 255
};
}
if (len === 8) {
return {
mode: "rgb",
r: (color >> 24 & 255) / 255,
g: (color >> 16 & 255) / 255,
b: (color >> 8 & 255) / 255,
alpha: (color & 255) / 255
};
}
};
parseNumber_default = parseNumber;
}
});
// ../node_modules/culori/src/colors/named.js
var named, named_default;
var init_named = __esm({
"../node_modules/culori/src/colors/named.js"() {
"use strict";
named = {
aliceblue: 15792383,
antiquewhite: 16444375,
aqua: 65535,
aquamarine: 8388564,
azure: 15794175,
beige: 16119260,
bisque: 16770244,
black: 0,
blanchedalmond: 16772045,
blue: 255,
blueviolet: 9055202,
brown: 10824234,
burlywood: 14596231,
cadetblue: 6266528,
chartreuse: 8388352,
chocolate: 13789470,
coral: 16744272,
cornflowerblue: 6591981,
cornsilk: 16775388,
crimson: 14423100,
cyan: 65535,
darkblue: 139,
darkcyan: 35723,
darkgoldenrod: 12092939,
darkgray: 11119017,
darkgreen: 25600,
darkgrey: 11119017,
darkkhaki: 12433259,
darkmagenta: 9109643,
darkolivegreen: 5597999,
darkorange: 16747520,
darkorchid: 10040012,
darkred: 9109504,
darksalmon: 15308410,
darkseagreen: 9419919,
darkslateblue: 4734347,
darkslategray: 3100495,
darkslategrey: 3100495,
darkturquoise: 52945,
darkviolet: 9699539,
deeppink: 16716947,
deepskyblue: 49151,
dimgray: 6908265,
dimgrey: 6908265,
dodgerblue: 2003199,
firebrick: 11674146,
floralwhite: 16775920,
forestgreen: 2263842,
fuchsia: 16711935,
gainsboro: 14474460,
ghostwhite: 16316671,
gold: 16766720,
goldenrod: 14329120,
gray: 8421504,
green: 32768,
greenyellow: 11403055,
grey: 8421504,
honeydew: 15794160,
hotpink: 16738740,
indianred: 13458524,
indigo: 4915330,
ivory: 16777200,
khaki: 15787660,
lavender: 15132410,
lavenderblush: 16773365,
lawngreen: 8190976,
lemonchiffon: 16775885,
lightblue: 11393254,
lightcoral: 15761536,
lightcyan: 14745599,
lightgoldenrodyellow: 16448210,
lightgray: 13882323,
lightgreen: 9498256,
lightgrey: 13882323,
lightpink: 16758465,
lightsalmon: 16752762,
lightseagreen: 2142890,
lightskyblue: 8900346,
lightslategray: 7833753,
lightslategrey: 7833753,
lightsteelblue: 11584734,
lightyellow: 16777184,
lime: 65280,
limegreen: 3329330,
linen: 16445670,
magenta: 16711935,
maroon: 8388608,
mediumaquamarine: 6737322,
mediumblue: 205,
mediumorchid: 12211667,
mediumpurple: 9662683,
mediumseagreen: 3978097,
mediumslateblue: 8087790,
mediumspringgreen: 64154,
mediumturquoise: 4772300,
mediumvioletred: 13047173,
midnightblue: 1644912,
mintcream: 16121850,
mistyrose: 16770273,
moccasin: 16770229,
navajowhite: 16768685,
navy: 128,
oldlace: 16643558,
olive: 8421376,
olivedrab: 7048739,
orange: 16753920,
orangered: 16729344,
orchid: 14315734,
palegoldenrod: 15657130,
palegreen: 10025880,
paleturquoise: 11529966,
palevioletred: 14381203,
papayawhip: 16773077,
peachpuff: 16767673,
peru: 13468991,
pink: 16761035,
plum: 14524637,
powderblue: 11591910,
purple: 8388736,
// Added in CSS Colors Level 4:
// https://drafts.csswg.org/css-color/#changes-from-3
rebeccapurple: 6697881,
red: 16711680,
rosybrown: 12357519,
royalblue: 4286945,
saddlebrown: 9127187,
salmon: 16416882,
sandybrown: 16032864,
seagreen: 3050327,
seashell: 16774638,
sienna: 10506797,
silver: 12632256,
skyblue: 8900331,
slateblue: 6970061,
slategray: 7372944,
slategrey: 7372944,
snow: 16775930,
springgreen: 65407,
steelblue: 4620980,
tan: 13808780,
teal: 32896,
thistle: 14204888,
tomato: 16737095,
turquoise: 4251856,
violet: 15631086,
wheat: 16113331,
white: 16777215,
whitesmoke: 16119285,
yellow: 16776960,
yellowgreen: 10145074
};
named_default = named;
}
});
// ../node_modules/culori/src/rgb/parseNamed.js
var parseNamed, parseNamed_default;
var init_parseNamed = __esm({
"../node_modules/culori/src/rgb/parseNamed.js"() {
"use strict";
init_parseNumber();
init_named();
parseNamed = (color) => {
return parseNumber_default(named_default[color.toLowerCase()], 6);
};
parseNamed_default = parseNamed;
}
});
// ../node_modules/culori/src/rgb/parseHex.js
var hex, parseHex, parseHex_default;
var init_parseHex = __esm({
"../node_modules/culori/src/rgb/parseHex.js"() {
"use strict";
init_parseNumber();
hex = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i;
parseHex = (color) => {
let match;
return (match = color.match(hex)) ? parseNumber_default(parseInt(match[1], 16), match[1].length) : void 0;
};
parseHex_default = parseHex;
}
});
// ../node_modules/culori/src/util/regex.js
var num, num_none, per, per_none, num_per, num_per_none, hue, hue_none, c, rx_num_per_none;
var init_regex = __esm({
"../node_modules/culori/src/util/regex.js"() {
"use strict";
num = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";
num_none = `(?:${num}|none)`;
per = `${num}%`;
per_none = `(?:${num}%|none)`;
num_per = `(?:${num}%|${num})`;
num_per_none = `(?:${num}%|${num}|none)`;
hue = `(?:${num}(deg|grad|rad|turn)|${num})`;
hue_none = `(?:${num}(deg|grad|rad|turn)|${num}|none)`;
c = `\\s*,\\s*`;
rx_num_per_none = new RegExp("^" + num_per_none + "$");
}
});
// ../node_modules/culori/src/rgb/parseRgbLegacy.js
var rgb_num_old, rgb_per_old, parseRgbLegacy, parseRgbLegacy_default;
var init_parseRgbLegacy = __esm({
"../node_modules/culori/src/rgb/parseRgbLegacy.js"() {
"use strict";
init_regex();
rgb_num_old = new RegExp(
`^rgba?\\(\\s*${num}${c}${num}${c}${num}\\s*(?:,\\s*${num_per}\\s*)?\\)$`
);
rgb_per_old = new RegExp(
`^rgba?\\(\\s*${per}${c}${per}${c}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`
);
parseRgbLegacy = (color) => {
let res = { mode: "rgb" };
let match;
if (match = color.match(rgb_num_old)) {
if (match[1] !== void 0) {
res.r = match[1] / 255;
}
if (match[2] !== void 0) {
res.g = match[2] / 255;
}
if (match[3] !== void 0) {
res.b = match[3] / 255;
}
} else if (match = color.match(rgb_per_old)) {
if (match[1] !== void 0) {
res.r = match[1] / 100;
}
if (match[2] !== void 0) {
res.g = match[2] / 100;
}
if (match[3] !== void 0) {
res.b = match[3] / 100;
}
} else {
return void 0;
}
if (match[4] !== void 0) {
res.alpha = Math.max(0, Math.min(1, match[4] / 100));
} else if (match[5] !== void 0) {
res.alpha = Math.max(0, Math.min(1, +match[5]));
}
return res;
};
parseRgbLegacy_default = parseRgbLegacy;
}
});
// ../node_modules/culori/src/_prepare.js
var prepare, prepare_default;
var init_prepare = __esm({
"../node_modules/culori/src/_prepare.js"() {
"use strict";
init_parse();
prepare = (color, mode) => color === void 0 ? void 0 : typeof color !== "object" ? parse_default(color) : color.mode !== void 0 ? color : mode ? { ...color, mode } : void 0;
prepare_default = prepare;
}
});
// ../node_modules/culori/src/converter.js
var converter, converter_default;
var init_converter = __esm({
"../node_modules/culori/src/converter.js"() {
"use strict";
init_modes();
init_prepare();
converter = (target_mode = "rgb") => (color) => (color = prepare_default(color, target_mode)) !== void 0 ? (
// if the color's mode corresponds to our target mode
color.mode === target_mode ? (
// then just return the color
color
) : (
// otherwise check to see if we have a dedicated
// converter for the target mode
converters[color.mode][target_mode] ? (
// and return its result...
converters[color.mode][target_mode](color)
) : (
// ...otherwise pass through RGB as an intermediary step.
// if the target mode is RGB...
target_mode === "rgb" ? (
// just return the RGB
converters[color.mode].rgb(color)
) : (
// otherwise convert color.mode -> RGB -> target_mode
converters.rgb[target_mode](converters[color.mode].rgb(color))
)
)
)
) : void 0;
converter_default = converter;
}
});
// ../node_modules/culori/src/modes.js
var converters, modes, parsers, colorProfiles, identity, useMode, getMode, useParser;
var init_modes = __esm({
"../node_modules/culori/src/modes.js"() {
"use strict";
init_converter();
converters = {};
modes = {};
parsers = [];
colorProfiles = {};
identity = (v) => v;
useMode = (definition29) => {
converters[definition29.mode] = {
...converters[definition29.mode],
...definition29.toMode
};
Object.keys(definition29.fromMode || {}).forEach((k4) => {
if (!converters[k4]) {
converters[k4] = {};
}
converters[k4][definition29.mode] = definition29.fromMode[k4];
});
if (!definition29.ranges) {
definition29.ranges = {};
}
if (!definition29.difference) {
definition29.difference = {};
}
definition29.channels.forEach((channel) => {
if (definition29.ranges[channel] === void 0) {
definition29.ranges[channel] = [0, 1];
}
if (!definition29.interpolate[channel]) {
throw new Error(`Missing interpolator for: ${channel}`);
}
if (typeof definition29.interpolate[channel] === "function") {
definition29.interpolate[channel] = {
use: definition29.interpolate[channel]
};
}
if (!definition29.interpolate[channel].fixup) {
definition29.interpolate[channel].fixup = identity;
}
});
modes[definition29.mode] = definition29;
(definition29.parse || []).forEach((parser) => {
useParser(parser, definition29.mode);
});
return converter_default(definition29.mode);
};
getMode = (mode) => modes[mode];
useParser = (parser, mode) => {
if (typeof parser === "string") {
if (!mode) {
throw new Error(`'mode' required when 'parser' is a string`);
}
colorProfiles[parser] = mode;
} else if (typeof parser === "function") {
if (parsers.indexOf(parser) < 0) {
parsers.push(parser);
}
}
};
}
});
// ../node_modules/culori/src/parse.js
function is_num(chars) {
let ch = chars[_i];
let ch1 = chars[_i + 1];
if (ch === "-" || ch === "+") {
return /\d/.test(ch1) || ch1 === "." && /\d/.test(chars[_i + 2]);
}
if (ch === ".") {
return /\d/.test(ch1);
}
return /\d/.test(ch);
}
function is_ident(chars) {
if (_i >= chars.length) {
return false;
}
let ch = chars[_i];
if (IdentStartCodePoint.test(ch)) {
return true;
}
if (ch === "-") {
if (chars.length - _i < 2) {
return false;
}
let ch1 = chars[_i + 1];
if (ch1 === "-" || IdentStartCodePoint.test(ch1)) {
return true;
}
return false;
}
return false;
}
function num2(chars) {
let value = "";
if (chars[_i] === "-" || chars[_i] === "+") {
value += chars[_i++];
}
value += digits(chars);
if (chars[_i] === "." && /\d/.test(chars[_i + 1])) {
value += chars[_i++] + digits(chars);
}
if (chars[_i] === "e" || chars[_i] === "E") {
if ((chars[_i + 1] === "-" || chars[_i + 1] === "+") && /\d/.test(chars[_i + 2])) {
value += chars[_i++] + chars[_i++] + digits(chars);
} else if (/\d/.test(chars[_i + 1])) {
value += chars[_i++] + digits(chars);
}
}
if (is_ident(chars)) {
let id = ident(chars);
if (id === "deg" || id === "rad" || id === "turn" || id === "grad") {
return { type: Tok.Hue, value: value * huenits[id] };
}
return void 0;
}
if (chars[_i] === "%") {
_i++;
return { type: Tok.Percentage, value: +value };
}
return { type: Tok.Number, value: +value };
}
function digits(chars) {
let v = "";
while (/\d/.test(chars[_i])) {
v += chars[_i++];
}
return v;
}
function ident(chars) {
let v = "";
while (_i < chars.length && IdentCodePoint.test(chars[_i])) {
v += chars[_i++];
}
return v;
}
function identlike(chars) {
let v = ident(chars);
if (chars[_i] === "(") {
_i++;
return { type: Tok.Function, value: v };
}
if (v === "none") {
return { type: Tok.None, value: void 0 };
}
return { type: Tok.Ident, value: v };
}
function tokenize(str = "") {
let chars = str.trim();
let tokens = [];
let ch;
_i = 0;
while (_i < chars.length) {
ch = chars[_i++];
if (ch === "\n" || ch === " " || ch === " ") {
while (_i < chars.length && (chars[_i] === "\n" || chars[_i] === " " || chars[_i] === " ")) {
_i++;
}
continue;
}
if (ch === ",") {
return void 0;
}
if (ch === ")") {
tokens.push({ type: Tok.ParenClose });
continue;
}
if (ch === "+") {
_i--;
if (is_num(chars)) {
tokens.push(num2(chars));
continue;
}
return void 0;
}
if (ch === "-") {
_i--;
if (is_num(chars)) {
tokens.push(num2(chars));
continue;
}
if (is_ident(chars)) {
tokens.push({ type: Tok.Ident, value: ident(chars) });
continue;
}
return void 0;
}
if (ch === ".") {
_i--;
if (is_num(chars)) {
tokens.push(num2(chars));
continue;
}
return void 0;
}
if (ch === "/") {
while (_i < chars.length && (chars[_i] === "\n" || chars[_i] === " " || chars[_i] === " ")) {
_i++;
}
let alpha;
if (is_num(chars)) {
alpha = num2(chars);
if (alpha.type !== Tok.Hue) {
tokens.push({ type: Tok.Alpha, value: alpha });
continue;
}
}
if (is_ident(chars)) {
if (ident(chars) === "none") {
tokens.push({
type: Tok.Alpha,
value: { type: Tok.None, value: void 0 }
});
continue;
}
}
return void 0;
}
if (/\d/.test(ch)) {
_i--;
tokens.push(num2(chars));
continue;
}
if (IdentStartCodePoint.test(ch)) {
_i--;
tokens.push(identlike(chars));
continue;
}
return void 0;
}
return tokens;
}
function parseColorSyntax(tokens) {
tokens._i = 0;
let token = tokens[tokens._i++];
if (!token || token.type !== Tok.Function || token.value !== "color") {
return void 0;
}
token = tokens[tokens._i++];
if (token.type !== Tok.Ident) {
return void 0;
}
const mode = colorProfiles[token.value];
if (!mode) {
return void 0;
}
const res = { mode };
const coords = consumeCoords(tokens, false);
if (!coords) {
return void 0;
}
const channels = getMode(mode).channels;
for (let ii = 0, c2, ch; ii < channels.length; ii++) {
c2 = coords[ii];
ch = channels[ii];
if (c2.type !== Tok.None) {
res[ch] = c2.type === Tok.Number ? c2.value : c2.value / 100;
if (ch === "alpha") {
res[ch] = Math.max(0, Math.min(1, res[ch]));
}
}
}
return res;
}
function consumeCoords(tokens, includeHue) {
const coords = [];
let token;
while (tokens._i < tokens.length) {
token = tokens[tokens._i++];
if (token.type === Tok.None || token.type === Tok.Number || token.type === Tok.Alpha || token.type === Tok.Percentage || includeHue && token.type === Tok.Hue) {
coords.push(token);
continue;
}
if (token.type === Tok.ParenClose) {
if (tokens._i < tokens.length) {
return void 0;
}
continue;
}
return void 0;
}
if (coords.length < 3 || coords.length > 4) {
return void 0;
}
if (coords.length === 4) {
if (coords[3].type !== Tok.Alpha) {
return void 0;
}
coords[3] = coords[3].value;
}
if (coords.length === 3) {
coords.push({ type: Tok.None, value: void 0 });
}
return coords.every((c2) => c2.type !== Tok.Alpha) ? coords : void 0;
}
function parseModernSyntax(tokens, includeHue) {
tokens._i = 0;
let token = tokens[tokens._i++];
if (!token || token.type !== Tok.Function) {
return void 0;
}
let coords = consumeCoords(tokens, includeHue);
if (!coords) {
return void 0;
}
coords.unshift(token.value);
return coords;
}
var IdentStartCodePoint, IdentCodePoint, Tok, _i, huenits, parse, parse_default;
var init_parse = __esm({
"../node_modules/culori/src/parse.js"() {
"use strict";
init_modes();
IdentStartCodePoint = /[^\x00-\x7F]|[a-zA-Z_]/;
IdentCodePoint = /[^\x00-\x7F]|[-\w]/;
Tok = {
Function: "function",
Ident: "ident",
Number: "number",
Percentage: "percentage",
ParenClose: ")",
None: "none",
Hue: "hue",
Alpha: "alpha"
};
_i = 0;
huenits = {
deg: 1,
rad: 180 / Math.PI,
grad: 9 / 10,
turn: 360
};
parse = (color) => {
if (typeof color !== "string") {
return void 0;
}
const tokens = tokenize(color);
const parsed = tokens ? parseModernSyntax(tokens, true) : void 0;
let result = void 0;
let i = 0;
let len = parsers.length;
while (i < len) {
if ((result = parsers[i++](color, parsed)) !== void 0) {
return result;
}
}
return tokens ? parseColorSyntax(tokens) : void 0;
};
parse_default = parse;
}
});
// ../node_modules/culori/src/rgb/parseRgb.js
function parseRgb(color, parsed) {
if (!parsed || parsed[0] !== "rgb" && parsed[0] !== "rgba") {
return void 0;
}
const res = { mode: "rgb" };
const [, r2, g, b, alpha] = parsed;
if (r2.type === Tok.Hue || g.type === Tok.Hue || b.type === Tok.Hue) {
return void 0;
}
if (r2.type !== Tok.None) {
res.r = r2.type === Tok.Number ? r2.value / 255 : r2.value / 100;
}
if (g.type !== Tok.None) {
res.g = g.type === Tok.Number ? g.value / 255 : g.value / 100;
}
if (b.type !== Tok.None) {
res.b = b.type === Tok.Number ? b.value / 255 : b.value / 100;
}
if (alpha.type !== Tok.None) {
res.alpha = Math.min(
1,
Math.max(
0,
alpha.type === Tok.Number ? alpha.value : alpha.value / 100
)
);
}
return res;
}
var parseRgb_default;
var init_parseRgb = __esm({
"../node_modules/culori/src/rgb/parseRgb.js"() {
"use strict";
init_parse();
parseRgb_default = parseRgb;
}
});
// ../node_modules/culori/src/rgb/parseTransparent.js
var parseTransparent, parseTransparent_default;
var init_parseTransparent = __esm({
"../node_modules/culori/src/rgb/parseTransparent.js"() {
"use strict";
parseTransparent = (c2) => c2 === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha: 0 } : void 0;
parseTransparent_default = parseTransparent;
}
});
// ../node_modules/culori/src/interpolate/lerp.js
var lerp;
var init_lerp = __esm({
"../node_modules/culori/src/interpolate/lerp.js"() {
"use strict";
lerp = (a, b, t) => a + t * (b - a);
}
});
// ../node_modules/culori/src/interpolate/piecewise.js
var get_classes, interpolatorPiecewise;
var init_piecewise = __esm({
"../node_modules/culori/src/interpolate/piecewise.js"() {
"use strict";
get_classes = (arr) => {
let classes = [];
for (let i = 0; i < arr.length - 1; i++) {
let a = arr[i];
let b = arr[i + 1];
if (a === void 0 && b === void 0) {
classes.push(void 0);
} else if (a !== void 0 && b !== void 0) {
classes.push([a, b]);
} else {
classes.push(a !== void 0 ? [a, a] : [b, b]);
}
}
return classes;
};
interpolatorPiecewise = (interpolator) => (arr) => {
let classes = get_classes(arr);
return (t) => {
let cls = t * classes.length;
let idx = t >= 1 ? classes.length - 1 : Math.max(Math.floor(cls), 0);
let pair = classes[idx];
return pair === void 0 ? void 0 : interpolator(pair[0], pair[1], cls - idx);
};
};
}
});
// ../node_modules/culori/src/interpolate/linear.js
var interpolatorLinear;
var init_linear = __esm({
"../node_modules/culori/src/interpolate/linear.js"() {
"use strict";
init_lerp();
init_piecewise();
interpolatorLinear = interpolatorPiecewise(lerp);
}
});
// ../node_modules/culori/src/fixup/alpha.js
var fixupAlpha;
var init_alpha = __esm({
"../node_modules/culori/src/fixup/alpha.js"() {
"use strict";
fixupAlpha = (arr) => {
let some_defined = false;
let res = arr.map((v) => {
if (v !== void 0) {
some_defined = true;
return v;
}
return 1;
});
return some_defined ? res : arr;
};
}
});
// ../node_modules/culori/src/rgb/definition.js
var definition, definition_default;
var init_definition = __esm({
"../node_modules/culori/src/rgb/definition.js"() {
"use strict";
init_parseNamed();
init_parseHex();
init_parseRgbLegacy();
init_parseRgb();
init_parseTransparent();
init_linear();
init_alpha();
definition = {
mode: "rgb",
channels: ["r", "g", "b", "alpha"],
parse: [
parseRgb_default,
parseHex_default,
parseRgbLegacy_default,
parseNamed_default,
parseTransparent_default,
"srgb"
],
serialize: "srgb",
interpolate: {
r: interpolatorLinear,
g: interpolatorLinear,
b: interpolatorLinear,
alpha: { use: interpolatorLinear, fixup: fixupAlpha }
},
gamut: true,
white: { r: 1, g: 1, b: 1 },
black: { r: 0, g: 0, b: 0 }
};
definition_default = definition;
}
});
// ../node_modules/culori/src/a98/convertA98ToXyz65.js
var linearize, convertA98ToXyz65, convertA98ToXyz65_default;
var init_convertA98ToXyz65 = __esm({
"../node_modules/culori/src/a98/convertA98ToXyz65.js"() {
"use strict";
linearize = (v = 0) => Math.pow(Math.abs(v), 563 / 256) * Math.sign(v);
convertA98ToXyz65 = (a982) => {
let r2 = linearize(a982.r);
let g = linearize(a982.g);
let b = linearize(a982.b);
let res = {
mode: "xyz65",
x: 0.5766690429101305 * r2 + 0.1855582379065463 * g + 0.1882286462349947 * b,
y: 0.297344975250536 * r2 + 0.6273635662554661 * g + 0.0752914584939979 * b,
z: 0.0270313613864123 * r2 + 0.0706888525358272 * g + 0.9913375368376386 * b
};
if (a982.alpha !== void 0) {
res.alpha = a982.alpha;
}
return res;
};
convertA98ToXyz65_default = convertA98ToXyz65;
}
});
// ../node_modules/culori/src/a98/convertXyz65ToA98.js
var gamma, convertXyz65ToA98, convertXyz65ToA98_default;
var init_convertXyz65ToA98 = __esm({
"../node_modules/culori/src/a98/convertXyz65ToA98.js"() {
"use strict";
gamma = (v) => Math.pow(Math.abs(v), 256 / 563) * Math.sign(v);
convertXyz65ToA98 = ({ x, y, z, alpha }) => {
if (x === void 0) x = 0;
if (y === void 0) y = 0;
if (z === void 0) z = 0;
let res = {
mode: "a98",
r: gamma(
x * 2.0415879038107465 - y * 0.5650069742788597 - 0.3447313507783297 * z
),
g: gamma(
x * -0.9692436362808798 + y * 1.8759675015077206 + 0.0415550574071756 * z
),
b: gamma(
x * 0.0134442806320312 - y * 0.1183623922310184 + 1.0151749943912058 * z
)
};
if (alpha !== void 0) {
res.alpha = alpha;
}
return res;
};
convertXyz65ToA98_default = convertXyz65ToA98;
}
});
// ../node_modules/culori/src/lrgb/convertRgbToLrgb.js
var fn, convertRgbToLrgb, convertRgbToLrgb_default;
var init_convertRgbToLrgb = __esm({
"../node_modules/culori/src/lrgb/convertRgbToLrgb.js"() {
"use strict";
fn = (c2 = 0) => {
const abs2 = Math.abs(c2);
if (abs2 <= 0.04045) {
return c2 / 12.92;
}
return (Math.sign(c2) || 1) * Math.pow((abs2 + 0.055) / 1.055, 2.4);
};
convertRgbToLrgb = ({ r: r2, g, b, alpha }) => {
let res = {
mode: "lrgb",
r: fn(r2),
g: fn(g),
b: fn(b)
};
if (alpha !== void 0) res.alpha = alpha;
return res;
};
convertRgbToLrgb_default = convertRgbToLrgb;
}
});
// ../node_modules/culori/src/xyz65/convertRgbToXyz65.js
var convertRgbToXyz65, convertRgbToXyz65_default;
var init_convertRgbToXyz65 = __esm({
"../node_modules/culori/src/xyz65/convertRgbToXyz65.js"() {
"use strict";
init_convertRgbToLrgb();
convertRgbToXyz65 = (rgb3) => {
let { r: r2, g, b, alpha } = convertRgbToLrgb_default(rgb3);
let res = {
mode: "xyz65",
x: 0.4123907992659593 * r2 + 0.357584339383878 * g + 0.1804807884018343 * b,
y: 0.2126390058715102 * r2 + 0.715168678767756 * g + 0.0721923153607337 * b,
z: 0.0193308187155918 * r2 + 0.119194779794626 * g + 0.9505321522496607 * b
};
if (alpha !== void 0) {
res.alpha = alpha;
}
return res;
};
convertRgbToXyz65_default = convertRgbToXyz65;
}
});
// ../node_modules/culori/src/lrgb/convertLrgbToRgb.js
var fn2, convertLrgbToRgb, convertLrgbToRgb_default;
var init_convertLrgbToRgb = __esm({
"../node_modules/culori/src/lrgb/convertLrgbToRgb.js"() {
"use strict";
fn2 = (c2 = 0) => {
const abs2 = Math.abs(c2);
if (abs2 > 31308e-7) {
return (Math.sign(c2) || 1) * (1.055 * Math.pow(abs2, 1 / 2.4) - 0.055);
}
return c2 * 12.92;
};
convertLrgbToRgb = ({ r: r2, g, b, alpha }, mode = "rgb") => {
let res = {
mode,
r: fn2(r2),
g: fn2(g),
b: fn2(b)
};
if (alpha !== void 0) res.alpha = alpha;
return res;
};
convertLrgbToRgb_default = convertLrgbToRgb;
}
});
// ../node_modules/culori/src/xyz65/convertXyz65ToRgb.js
var convertXyz65ToRgb, convertXyz65ToRgb_default;
var init_convertXyz65ToRgb = __esm({
"../node_modules/culori/src/xyz65/convertXyz65ToRgb.js"() {
"use strict";
init_convertLrgbToRgb();
convertXyz65ToRgb = ({ x, y, z, alpha }) => {
if (x === void 0) x = 0;
if (y === void 0) y = 0;
if (z === void 0) z = 0;
let res = convertLrgbToRgb_default({
r: x * 3.2409699419045226 - y * 1.537383177570094 - 0.4986107602930034 * z,
g: x * -0.9692436362808796 + y * 1.8759675015077204 + 0.0415550574071756 * z,
b: x * 0.0556300796969936 - y * 0.2039769588889765 + 1.0569715142428784 * z
});
if (alpha !== void 0) {
res.alpha = alpha;
}
return res;
};
convertXyz65ToRgb_default = convertXyz65ToRgb;
}
});
// ../node_modules/culori/src/a98/definition.js
var definition2, definition_default2;
var init_definition2 = __esm({
"../node_modules/culori/src/a98/definition.js"() {
"use strict";
init_definition();
init_convertA98ToXyz65();
init_convertXyz65ToA98();
init_convertRgbToXyz65();
init_convertXyz65ToRgb();
definition2 = {
...definition_default,
mode: "a98",
parse: ["a98-rgb"],
serialize: "a98-rgb",
fromMode: {
rgb: (color) => convertXyz65ToA98_default(convertRgbToXyz65_default(color)),
xyz65: convertXyz65ToA98_default
},
toMode: {
rgb: (color) => convertXyz65ToRgb_default(convertA98ToXyz65_default(color)),
xyz65: convertA98ToXyz65_default
}
};
definition_default2 = definition2;
}
});
// ../node_modules/culori/src/util/normalizeHue.js
var normalizeHue, normalizeHue_default;
var init_normalizeHue = __esm({
"../node_modules/culori/src/util/normalizeHue.js"() {
"use strict";
normalizeHue = (hue3) => (hue3 = hue3 % 360) < 0 ? hue3 + 360 : hue3;
normalizeHue_default = normalizeHue;
}
});
// ../node_modules/culori/src/fixup/hue.js
var hue2, fixupHueShorter;
var init_hue = __esm({
"../node_modules/culori/src/fixup/hue.js"() {
"use strict";
init_normalizeHue();
hue2 = (hues, fn5) => {
return hues.map((hue3, idx, arr) => {
if (hue3 === void 0) {
return hue3;
}
let normalized = normalizeHue_default(hue3);
if (idx === 0 || hues[idx - 1] === void 0) {
return normalized;
}
return fn5(normalized - normalizeHue_default(arr[idx - 1]));
}).reduce((acc, curr) => {
if (!acc.length || curr === void 0 || acc[acc.length - 1] === void 0) {
acc.push(curr);
return acc;
}
acc.push(curr + acc[acc.length - 1]);
return acc;
}, []);
};
fixupHueShorter = (arr) => hue2(arr, (d) => Math.abs(d) <= 180 ? d : d - 360 * Math.sign(d));
}
});
// ../node_modules/culori/src/cubehelix/constants.js
var M, degToRad, radToDeg;
var init_constants = __esm({
"../node_modules/culori/src/cubehelix/constants.js"() {
"use strict";
M = [-0.14861, 1.78277, -0.29227, -0.90649, 1.97294, 0];
degToRad = Math.PI / 180;
radToDeg = 180 / Math.PI;
}
});
// ../node_modules/culori/src/cubehelix/convertRgbToCubehelix.js
var DE, BE, BCAD, convertRgbToCubehelix, convertRgbToCubehelix_default;
var init_convertRgbToCubehelix = __esm({
"../node_modules/culori/src/cubehelix/convertRgbToCubehelix.js"() {
"use strict";
init_constants();
DE = M[3] * M[4];
BE = M[1] * M[4];
BCAD = M[1] * M[2] - M[0] * M[3];
convertRgbToCubehelix = ({ r: r2, g, b, alpha }) => {
if (r2 === void 0) r2 = 0;
if (g === void 0) g = 0;
if (b === void 0) b = 0;
let l = (BCAD * b + r2 * DE - g * BE) / (BCAD + DE - BE);
let x = b - l;
let y = (M[4] * (g - l) - M[2] * x) / M[3];
let res = {
mode: "cubehelix",
l,
s: l === 0 || l === 1 ? void 0 : Math.sqrt(x * x + y * y) / (M[4] * l * (1 - l))
};
if (res.s) res.h = Math.atan2(y, x) * radToDeg - 120;
if (alpha !== void 0) res.alpha = alpha;
return res;
};
convertRgbToCubehelix_default = convertRgbToCubehelix;
}
});
// ../node_modules/culori/src/cubehelix/convertCubehelixToRgb.js
var convertCubehelixToRgb, convertCubehelixToRgb_default;
var init_convertCubehelixToRgb = __esm({
"../node_modules/culori/src/cubehelix/convertCubehelixToRgb.js"() {
"use strict";
init_constants();
convertCubehelixToRgb = ({ h, s, l, alpha }) => {
let res = { mode: "rgb" };
h = (h === void 0 ? 0 : h + 120) * degToRad;
if (l === void 0) l = 0;
let amp = s === void 0 ? 0 : s * l * (1 - l);
let cosh = Math.cos(h);
let sinh = Math.sin(h);
res.r = l + amp * (M[0] * cosh + M[1] * sinh);
res.g = l + amp * (M[2] * cosh + M[3] * sinh);
res.b = l + amp * (M[4] * cosh + M[5] * sinh);
if (alpha !== void 0) res.alpha = alpha;
return res;
};
convertCubehelixToRgb_default = convertCubehelixToRgb;
}
});
// ../node_modules/culori/src/difference.js
var differenceHueSaturation, differenceHueNaive, differenceHueChroma;
var init_difference = __esm({
"../node_modules/culori/src/difference.js"() {
"use strict";
init_normalizeHue();
differenceHueSaturation = (std, smp) => {
if (std.h === void 0 || smp.h === void 0 || !std.s || !smp.s) {
return 0;
}
let std_h = normalizeHue_default(std.h);
let smp_h = normalizeHue_default(smp.h);
let dH = Math.sin((smp_h - std_h + 360) / 2 * Math.PI / 180);
return 2 * Math.sqrt(std.s * smp.s) * dH;
};
differenceHueNaive = (std, smp) => {
if (std.h === void 0 || smp.h === void 0) {
return 0;
}
let std_h = normalizeHue_default(std.h);
let smp_h = normalizeHue_default(smp.h);
if (Math.abs(smp_h - std_h) > 180) {
return std_h - (smp_h - 360 * Math.sign(smp_h - std_h));
}
return smp_h - std_h;
};
differenceHueChroma = (std, smp) => {
if (std.h === void 0 || smp.h === void 0 || !std.c || !smp.c) {
return 0;
}
let std_h = normalizeHue_default(std.h);
let smp_h = normalizeHue_default(smp.h);
let dH = Math.sin((smp_h - std_h + 360) / 2 * Math.PI / 180);
return 2 * Math.sqrt(std.c * smp.c) * dH;
};
}
});
// ../node_modules/culori/src/average.js
var averageAngle;
var init_average = __esm({
"../node_modules/culori/src/average.js"() {
"use strict";
averageAngle = (val) => {
let sum = val.reduce(
(sum2, val2) => {
if (val2 !== void 0) {
let rad = val2 * Math.PI / 180;
sum2.sin += Math.sin(rad);
sum2.cos += Math.cos(rad);
}
return sum2;
},
{ sin: 0, cos: 0 }
);
let angle = Math.atan2(sum.sin, sum.cos) * 180 / Math.PI;
return angle < 0 ? 360 + angle : angle;
};
}
});
// ../node_modules/culori/src/cubehelix/definition.js
var definition3, definition_default3;
var init_definition3 = __esm({
"../node_modules/culori/src/cubehelix/definition.js"() {
"use strict";
init_hue();
init_alpha();
init_linear();
init_convertRgbToCubehelix();
init_convertCubehelixToRgb();
init_difference();
init_average();
definition3 = {
mode: "cubehelix",
channels: ["h", "s", "l", "alpha"],
parse: ["--cubehelix"],
serialize: "--cubehelix",
ranges: {
h: [0, 360],
s: [0, 4.614],
l: [0, 1]
},
fromMode: {
rgb: convertRgbToCubehelix_default
},
toMode: {
rgb: convertCubehelixToRgb_default
},
interpolate: {
h: {
use: interpolatorLinear,
fixup: fixupHueShorter
},
s: interpolatorLinear,
l: interpolatorLinear,
alpha: {
use: interpolatorLinear,
fixup: fixupAlpha
}
},
difference: {
h: differenceHueSaturation
},
average: {
h: averageAngle
}
};
definition_default3 = definition3;
}
});
// ../node_modules/culori/src/lch/convertLabToLch.js
var convertLabToLch, convertLabToLch_default;
var init_convertLabToLch = __esm({
"../node_modules/culori/src/lch/convertLabToLch.js"() {
"use strict";
init_normalizeHue();
convertLabToLch = ({ l, a, b, alpha }, mode = "lch") => {
if (a === void 0) a = 0;
if (b === void 0) b = 0;
let c2 = Math.sqrt(a * a + b * b);
let res = { mode, l, c: c2 };
if (c2) res.h = normalizeHue_default(Math.atan2(b, a) * 180 / Math.PI);
if (alpha !== void 0) res.alpha = alpha;
return res;
};
convertLabToLch_default = convertLabToLch;
}
});
// ../node_modules/culori/src/lch/convertLchToLab.js
var convertLchToLab, convertLchToLab_default;
var init_convertLchToLab = __esm({
"../node_modules/culori/src/lch/convertLchToLab.js"() {
"use strict";
convertLchToLab = ({ l, c: c2, h, alpha }, mode = "lab") => {
if (h === void 0) h = 0;
let res = {
mode,
l,
a: c2 ? c2 * Math.cos(h / 180 * Math.PI) : 0,
b: c2 ? c2 * Math.sin(h / 180 * Math.PI) : 0
};
if (alpha !== void 0) res.alpha = alpha;
return res;
};
convertLchToLab_default = convertLchToLab;
}
});
// ../node_modules/culori/src/xyz65/constants.js
var k, e;
var init_constants2 = __esm({
"../node_modules/culori/src/xyz65/constants.js"() {
"use strict";
k = Math.pow(29, 3) / Math.pow(3, 3);
e = Math.pow(6, 3) / Math.pow(29, 3);
}
});
// ../node_modules/culori/src/constants.js
var D50, D65, k2, e2;
var init_constants3 = __esm({
"../node_modules/culori/src/constants.js"() {
"use strict";
D50 = {
X: 0.3457 / 0.3585,
Y: 1,
Z: (1 - 0.3457 - 0.3585) / 0.3585
};
D65 = {
X: 0.3127 / 0.329,
Y: 1,
Z: (1 - 0.3127 - 0.329) / 0.329
};
k2 = Math.pow(29, 3) / Math.pow(3, 3);
e2 = Math.pow(6, 3) / Math.pow(29, 3);
}
});
// ../node_modules/culori/src/lab65/convertLab65ToXyz65.js
var fn3, convertLab65ToXyz65, convertLab65ToXyz65_default;
var init_convertLab65ToXyz65 = __esm({
"../node_modules/culori/src/lab65/convertLab65ToXyz65.js"() {
"use strict";
init_constants2();
init_constants3();
fn3 = (v) => Math.pow(v, 3) > e ? Math.pow(v, 3) : (116 * v - 16) / k;
convertLab65ToXyz65 = ({ l, a, b, alpha }) => {
if (l === void 0) l = 0;
if (a === void 0) a = 0;
if (b === void 0) b = 0;
let fy = (l + 16) / 116;
let fx = a / 500 + fy;
let fz = fy - b / 200;
let res = {
mode: "xyz65",
x: fn3(fx) * D65.X,
y: fn3(fy) * D65.Y,
z: fn3(fz) * D65.Z
};
if (alpha !== void 0) {
res.alpha = alpha;
}
return res;
};
convertLab65ToXyz65_default = convertLab65ToXyz65;
}
});
// ../node_modules/culori/src/lab65/convertLab65ToRgb.js
var convertLab65ToRgb, convertLab65ToRgb_default;
var init_convertLab65ToRgb = __esm({
"../node_modules/culori/src/lab65/convertLab65ToRgb.js"() {
"use strict";
init_convertLab65ToXyz65();
init_convertXyz65ToRgb();
convertLab65ToRgb = (lab2) => convertXyz65ToRgb_default(convertLab65ToXyz65_default(lab2));
convertLab65ToRgb_default = convertLab65ToRgb;
}
});
// ../node_modules/culori/src/lab65/convertXyz65ToLab65.js
var f, convertXyz65ToLab65, convertXyz65ToLab65_default;
var init_convertXyz65ToLab65 = __esm({
"../node_modules/culori/src/lab65/convertXyz65ToLab65.js"() {
"use strict";
init_constants2();
init_constants3();
f = (value) => value > e ? Math.cbrt(value) : (k * value + 16) / 116;
convertXyz65ToLab65 = ({ x, y, z, alpha }) => {
if (x === void 0) x = 0;
if (y === void 0) y = 0;
if (z === void 0) z = 0;
let f0 = f(x / D65.X);
let f1 = f(y / D65.Y);
let f22 = f(z / D65.Z);
let res = {
mode: "lab65",
l: 116 * f1 - 16,
a: 500 * (f0 - f1),
b: 200 * (f1 - f22)
};
if (alpha !== void 0) {
res.alpha = alpha;
}
return res;
};
convertXyz65ToLab65_default = convertXyz65ToLab65;
}
});
// ../node_modules/culori/src/lab65/convertRgbToLab65.js
var convertRgbToLab65, convertRgbToLab65_default;
var init_convertRgbToLab65 = __esm({
"../node_modules/culori/src/lab65/convertRgbToLab65.js"() {
"use strict";
init_convertRgbToXyz65();
init_convertXyz65ToLab65();
convertRgbToLab65 = (rgb3) => {
let res = convertXyz65ToLab65_default(convertRgbToXyz65_default(rgb3));
if (rgb3.r === rgb3.b && rgb3.b === rgb3.g) {
res.a = res.b = 0;
}
return res;
};
convertRgbToLab65_default = convertRgbToLab65;
}
});
// ../node_modules/culori/src/dlch/constants.js
var kE, kCH, \u03B8, cos\u03B8, sin\u03B8, factor;
var init_constants4 = __esm({
"../node_modules/culori/src/dlch/constants.js"() {
"use strict";
kE = 1;
kCH = 1;
\u03B8 = 26 / 180 * Math.PI;
cos\u03B8 = Math.cos(\u03B8);
sin\u03B8 = Math.sin(\u03B8);
factor = 100 / Math.log(139 / 100);
}
});
// ../node_modules/culori/src/dlch/convertDlchToLab65.js
var convertDlchToLab65, convertDlchToLab65_default;
var init_convertDlchToLab65 = __esm({
"../node_modules/culori/src/dlch/convertDlchToLab65.js"() {
"use strict";
init_constants4();
convertDlchToLab65 = ({ l, c: c2, h, alpha }) => {
if (l === void 0) l = 0;
if (c2 === void 0) c2 = 0;
if (h === void 0) h = 0;
let res = {
mode: "lab65",
l: (Math.exp(l * kE / factor) - 1) / 39e-4
};
let G = (Math.exp(0.0435 * c2 * kCH * kE) - 1) / 0.075;
let e4 = G * Math.cos(h / 180 * Math.PI - \u03B8);
let f3 = G * Math.sin(h / 180 * Math.PI - \u03B8);
res.a = e4 * cos\u03B8 - f3 / 0.83 * sin\u03B8;
res.b = e4 * sin\u03B8 + f3 / 0.83 * cos\u03B8;
if (alpha !== void 0) res.alpha = alpha;
return res;
};
convertDlchToLab65_default = convertDlchToLab65;
}
});
// ../node_modules/culori/src/dlch/convertLab65ToDlch.js
var convertLab65ToDlch, convertLab65ToDlch_default;
var init_convertLab65ToDlch = __esm({
"../node_modules/culori/src/dlch/convertLab65ToDlch.js"() {
"use strict";
init_constants4();
init_normalizeHue();
convertLab65ToDlch = ({ l, a, b, alpha }) => {
if (l === void 0) l = 0;
if (a === void 0) a = 0;
if (b === void 0) b = 0;
let e4 = a * cos\u03B8 + b * sin\u03B8;
let f3 = 0.83 * (b * cos\u03B8 - a * sin\u03B8);
let G = Math.sqrt(e4 * e4 + f3 * f3);
let res = {
mode: "dlch",
l: factor / kE * Math.log(1 + 39e-4 * l),
c: Math.log(1 + 0.075 * G) / (0.0435 * kCH * kE)
};
if (res.c) {
res.h = normalizeHue_default((Math.atan2(f3, e4) + \u03B8) / Math.PI * 180);
}
if (alpha !== void 0) res.alpha = alpha;
return res;
};
convertLab65ToDlch_default = convertLab65ToDlch;
}
});
// ../node_modules/culori/src/dlab/definition.js
var convertDlabToLab65, convertLab65ToDlab, definition4, definition_default4;
var init_definition4 = __esm({
"../node_modules/culori/src/dlab/definition.js"() {
"use strict";
init_convertLabToLch();
init_convertLchToLab();
init_convertLab65ToRgb();
init_convertRgbToLab65();
init_convertDlchToLab65();
init_convertLab65ToDlch();
init_linear();
init_alpha();
convertDlabToLab65 = (c2) => convertDlchToLab65_default(convertLabToLch_default(c2, "dlch"));
convertLab65ToDlab = (c2) => convertLchToLab_default(convertLab65ToDlch_default(c2), "dlab");
definition4 = {
mode: "dlab",
parse: ["--din99o-lab"],
serialize: "--din99o-lab",
toMode: {
lab65: convertDlabToLab65,
rgb: (c2) => convertLab65ToRgb_default(convertDlabToLab65(c2))
},
fromMode: {
lab65: convertLab65ToDlab,
rgb: (c2) => convertLab65ToDlab(convertRgbToLab65_default(c2))
},
channels: ["l", "a", "b", "alpha"],
ranges: {
l: [0, 100],
a: [-40.09, 45.501],
b: [-40.469, 44.344]
},
interpolate: {
l: interpolatorLinear,
a: interpolatorLinear,
b: interpolatorLinear,
alpha: {
use: interpolatorLinear,
fixup: fixupAlpha
}
}
};
definition_default4 = definition4;
}
});
// ../node_modules/culori/src/dlch/definition.js
var definition5, definition_default5;
var init_definition5 = __esm({
"../node_modules/culori/src/dlch/definition.js"() {
"use strict";
init_convertLabToLch();
init_convertLchToLab();
init_convertDlchToLab65();
init_convertLab65ToDlch();
init_convertLab65ToRgb();
init_convertRgbToLab65();
init_hue();
init_alpha();
init_linear();
init_difference();
init_average();
definition5 = {
mode: "dlch",
parse: ["--din99o-lch"],
serialize: "--din99o-lch",
toMode: {
lab65: convertDlchToLab65_default,
dlab: (c2) => convertLchToLab_default(c2, "dlab"),
rgb: (c2) => convertLab65ToRgb_default(convertDlchToLab65_default(c2))
},
fromMode: {
lab65: convertLab65ToDlch_default,
dlab: (c2) => convertLabToLch_default(c2, "dlch"),
rgb: (c2) => convertLab65ToDlch_default(convertRgbToLab65_default(c2))
},
channels: ["l", "c", "h", "alpha"],
ranges: {
l: [0, 100],
c: [0, 51.484],
h: [0, 360]
},
interpolate: {
l: interpolatorLinear,
c: interpolatorLinear,
h: {
use: interpolatorLinear,
fixup: fixupHueShorter
},
alpha: {
use: interpolatorLinear,
fixup: fixupAlpha
}
},
difference: {
h: differenceHueChroma
},
average: {
h: averageAngle
}
};
definition_default5 = definition5;
}
});
// ../node_modules/culori/src/hsi/convertHsiToRgb.js
function convertHsiToRgb({ h, s, i, alpha }) {
h = normalizeHue_default(h !== void 0 ? h : 0);
if (s === void 0) s = 0;
if (i === void 0) i = 0;
let f3 = Math.abs(h / 60 % 2 - 1);
let res;
switch (Math.floor(h / 60)) {
case 0:
res = {
r: i * (1 + s * (3 / (2 - f3) - 1)),
g: i * (1 + s * (3 * (1 - f3) / (2 - f3) - 1)),
b: i * (1 - s)
};
break;
case 1:
res = {
r: i * (1 + s * (3 * (1 - f3) / (2 - f3) - 1)),
g: i * (1 + s * (3 / (2 - f3) - 1)),
b: i * (1 - s)
};
break;
case 2:
res = {
r: i * (1 - s),
g: i * (1 + s * (3 / (2 - f3) - 1)),
b: i * (1 + s * (3 * (1 - f3) / (2 - f3) - 1))
};
break;
case 3:
res = {
r: i * (1 - s),
g: i * (1 + s * (3 * (1 - f3) / (2 - f3) - 1)),
b: i * (1 + s * (3 / (2 - f3) - 1))
};
break;
case 4:
res = {
r: i * (1 + s * (3 * (1 - f3) / (2 - f3) - 1)),
g: i * (1 - s),
b: i * (1 + s * (3 / (2 - f3) - 1))
};
break;
case 5:
res = {
r: i * (1 + s * (3 / (2 - f3) - 1)),
g: i * (1 - s),
b: i * (1 + s * (3 * (1 - f3) / (2 - f3) - 1))
};
break;
default:
res = { r: i * (1 - s), g: i * (1 - s), b: i * (1 - s) };
}
res.mode = "rgb";
if (alpha !== void 0) res.alpha = alpha;
return res;
}
var init_convertHsiToRgb = __esm({
"../node_modules/culori/src/hsi/convertHsiToRgb.js"() {
"use strict";
init_normalizeHue();
}
});
// ../node_modules/culori/src/hsi/convertRgbToHsi.js
function convertRgbToHsi({ r: r2, g, b, alpha }) {
if (r2 === void 0) r2 = 0;
if (g === void 0) g = 0;
if (b === void 0) b = 0;
let M3 = Math.max(r2, g, b), m = Math.min(r2, g, b);
let res = {
mode: "hsi",
s: r2 + g + b === 0 ? 0 : 1 - 3 * m / (r2 + g + b),
i: (r2 + g + b) / 3
};
if (M3 - m !== 0)
res.h = (M3 === r2 ? (g - b) / (M3 - m) + (g < b) * 6 : M3 === g ? (b - r2) / (M3 - m) + 2 : (r2 - g) / (M3 - m) + 4) * 60;
if (alpha !== void 0) res.alpha = alpha;
return res;
}
var init_convertRgbToHsi = __esm({
"../node_modules/culori/src/hsi/convertRgbToHsi.js"() {
"use strict";
}
});
// ../node_modules/culori/src/hsi/definition.js
var definition6, definition_default6;
var init_definition6 = __esm({
"../node_modules/culori/src/hsi/definition.js"() {
"use strict";
init_convertHsiToRgb();
init_convertRgbToHsi();
init_hue();
init_alpha();
init_linear();
init_difference();
init_average();
definition6 = {
mode: "hsi",
toMode: {
rgb: convertHsiToRgb