840 lines
31 KiB
JavaScript
840 lines
31 KiB
JavaScript
// Metro module 1649 (f1650).
|
|
import { makeShareable } from "./Module1650";
|
|
import * as _Module1609 from "./Module1609";
|
|
let c1305_0, hue2rgb, hslToRgb, hwbToRgb, parse255, parse360, parse1, parsePercentage, c1305_8, c1305_9, c1305_10, normalizeColor, s2, HSVtoRGB, processColorInitially, isAndroid, processColor;
|
|
const call = function call() {
|
|
return "\\(\\s*(" + Array.prototype.slice.call(arguments, 0).join(")\\s*,?\\s*(") + ")\\s*\\)";
|
|
};
|
|
const callWithSlashSeparator = function callWithSlashSeparator(...args) {
|
|
return "\\(\\s*(" + args.slice(0, args.length - 1).join(")\\s*,?\\s*(") + ")\\s*/\\s*(" + args[args.length - 1] + ")\\s*\\)";
|
|
};
|
|
const commaSeparatedCall = function commaSeparatedCall() {
|
|
return "\\(\\s*(" + Array.prototype.slice.call(arguments, 0).join(")\\s*,\\s*(") + ")\\s*\\)";
|
|
};
|
|
c1305_0 = {
|
|
rgb: new RegExp("rgb" + call("[-+]?\\d*\\.?\\d+", "[-+]?\\d*\\.?\\d+", "[-+]?\\d*\\.?\\d+")),
|
|
rgba: new RegExp(`rgba(${commaSeparatedCall("[-+]?\\d*\\.?\\d+", "[-+]?\\d*\\.?\\d+", "[-+]?\\d*\\.?\\d+", "[-+]?\\d*\\.?\\d+")}|${callWithSlashSeparator("[-+]?\\d*\\.?\\d+", "[-+]?\\d*\\.?\\d+", "[-+]?\\d*\\.?\\d+", "[-+]?\\d*\\.?\\d+")})`),
|
|
hsl: new RegExp("hsl" + call("[-+]?\\d*\\.?\\d+", "[-+]?\\d*\\.?\\d+%", "[-+]?\\d*\\.?\\d+%")),
|
|
hsla: new RegExp(`hsla(${commaSeparatedCall("[-+]?\\d*\\.?\\d+", "[-+]?\\d*\\.?\\d+%", "[-+]?\\d*\\.?\\d+%", "[-+]?\\d*\\.?\\d+")}|${callWithSlashSeparator("[-+]?\\d*\\.?\\d+", "[-+]?\\d*\\.?\\d+%", "[-+]?\\d*\\.?\\d+%", "[-+]?\\d*\\.?\\d+")})`),
|
|
hwb: new RegExp("hwb" + call("[-+]?\\d*\\.?\\d+", "[-+]?\\d*\\.?\\d+%", "[-+]?\\d*\\.?\\d+%")),
|
|
hex3: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
hex4: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
hex6: /^#([0-9a-fA-F]{6})$/,
|
|
hex8: /^#([0-9a-fA-F]{8})$/
|
|
};
|
|
const hue2rgb2 = function hue2rgb(a0, a1, a2) {
|
|
const r2 = a2 < 0 ? a2 + 1 : a2;
|
|
let r4 = r2;
|
|
if (r4 > 1) {
|
|
r4 = r2 - 1;
|
|
}
|
|
return r4 < 0.16666666666666666 ? a0 + 6 * (a1 - a0) * r4 : r4 < 0.5 ? a1 : r4 < 0.6666666666666666 ? a0 + (a1 - a0) * (0.6666666666666666 - r4) * 6 : a0;
|
|
};
|
|
hue2rgb2.__closure = {};
|
|
hue2rgb2.__workletHash = 13577481829661;
|
|
hue2rgb2.__initData = {
|
|
code: "function hue2rgb_Pnpm_ColorsTs1(p,q,t){if(t<0){t+=1;}if(t>1){t-=1;}if(t<1/6){return p+(q-p)*6*t;}if(t<1/2){return q;}if(t<2/3){return p+(q-p)*(2/3-t)*6;}return p;}"
|
|
};
|
|
hue2rgb = hue2rgb2;
|
|
const hslToRgb2 = function hslToRgb(a0, a1, a2) {
|
|
const r17 = a2 < 0.5 ? a2 * (1 + a1) : a2 + a1 - a2 * a1;
|
|
const r23 = 2 * a2 - r17;
|
|
const r25 = a0 + 0.3333333333333333;
|
|
let r26 = r25;
|
|
if (r26 < 0) {
|
|
r26 = r25 + 1;
|
|
}
|
|
let r27 = r26;
|
|
if (r27 > 1) {
|
|
r27 = r26 - 1;
|
|
}
|
|
const r15 = r27 < 0.16666666666666666 ? r23 + 6 * (r17 - r23) * r27 : r27 < 0.5 ? r17 : r27 < 0.6666666666666666 ? r23 + (r17 - r23) * (0.6666666666666666 - r27) * 6 : r23;
|
|
const r38 = a0 < 0 ? a0 + 1 : a0;
|
|
let r39 = r38;
|
|
if (r39 > 1) {
|
|
r39 = r38 - 1;
|
|
}
|
|
const r40 = r39 < 0.16666666666666666 ? r23 + 6 * (r17 - r23) * r39 : r39 < 0.5 ? r17 : r39 < 0.6666666666666666 ? r23 + (r17 - r23) * (0.6666666666666666 - r39) * 6 : r23;
|
|
const r52 = a0 - 0.3333333333333333;
|
|
let r55 = r52;
|
|
if (r55 < 0) {
|
|
r55 = r52 + 1;
|
|
}
|
|
let r56 = r55;
|
|
if (1 < r56) {
|
|
r56 = r55 - 1;
|
|
}
|
|
const r57 = r56 < 0.16666666666666666 ? r23 + 6 * (r17 - r23) * r56 : r56 < 0.5 ? r17 : r56 < 0.6666666666666666 ? r23 + (r17 - r23) * (0.6666666666666666 - r56) * 6 : r23;
|
|
return Math.round(255 * r15) << 24 | Math.round(255 * r40) << 16 | Math.round(255 * r57) << 8;
|
|
};
|
|
hslToRgb2.__closure = {
|
|
hue2rgb
|
|
};
|
|
hslToRgb2.__workletHash = 1406907784351;
|
|
hslToRgb2.__initData = {
|
|
code: "function hslToRgb_Pnpm_ColorsTs2(h,s,l){const{hue2rgb}=this.__closure;const q=l<0.5?l*(1+s):l+s-l*s;const p=2*l-q;const r=hue2rgb(p,q,h+1/3);const g=hue2rgb(p,q,h);const b=hue2rgb(p,q,h-1/3);return Math.round(r*255)<<24|Math.round(g*255)<<16|Math.round(b*255)<<8;}"
|
|
};
|
|
hslToRgb = hslToRgb2;
|
|
const hwbToRgb2 = function hwbToRgb(a0, a1, a2) {
|
|
if (a1 + a2 >= 1) {
|
|
const r97 = Math.round(255 * a1 / (a1 + a2));
|
|
return r97 << 24 | r97 << 16 | r97 << 8;
|
|
}
|
|
const r13 = a0 + 0.3333333333333333;
|
|
let r20 = r13;
|
|
if (r20 < 0) {
|
|
r20 = r13 + 1;
|
|
}
|
|
let r21 = r20;
|
|
if (r21 > 1) {
|
|
r21 = r20 - 1;
|
|
}
|
|
const r16 = (r21 < 0.16666666666666666 ? 0 + 6 * r21 : r21 < 0.5 ? 1 : r21 < 0.6666666666666666 ? 0 + 1 * (0.6666666666666666 - r21) * 6 : 0) * (1 - a1 - a2) + a1;
|
|
const r33 = a0 < 0 ? a0 + 1 : a0;
|
|
let r34 = r33;
|
|
if (r34 > 1) {
|
|
r34 = r33 - 1;
|
|
}
|
|
const r15 = (r34 < 0.16666666666666666 ? 0 + 6 * r34 : r34 < 0.5 ? 1 : r34 < 0.6666666666666666 ? 0 + 1 * (0.6666666666666666 - r34) * 6 : 0) * (1 - a1 - a2) + a1;
|
|
const r49 = a0 - 0.3333333333333333;
|
|
let r52 = r49;
|
|
if (r52 < 0) {
|
|
r52 = r49 + 1;
|
|
}
|
|
let r53 = r52;
|
|
if (1 < r53) {
|
|
r53 = r52 - 1;
|
|
}
|
|
const r67 = (r53 < 0.16666666666666666 ? 0 + 6 * r53 : r53 < 0.5 ? 1 : r53 < 0.6666666666666666 ? 0 + 1 * (0.6666666666666666 - r53) * 6 : 0) * (1 - a1 - a2) + a1;
|
|
return Math.round(255 * r16) << 24 | Math.round(255 * r15) << 16 | Math.round(255 * r67) << 8;
|
|
};
|
|
hwbToRgb2.__closure = {
|
|
hue2rgb
|
|
};
|
|
hwbToRgb2.__workletHash = 16684751503669;
|
|
hwbToRgb2.__initData = {
|
|
code: "function hwbToRgb_Pnpm_ColorsTs3(h,w,b){const{hue2rgb}=this.__closure;if(w+b>=1){const gray=Math.round(w*255/(w+b));return gray<<24|gray<<16|gray<<8;}const red=hue2rgb(0,1,h+1/3)*(1-w-b)+w;const green=hue2rgb(0,1,h)*(1-w-b)+w;const blue=hue2rgb(0,1,h-1/3)*(1-w-b)+w;return Math.round(red*255)<<24|Math.round(green*255)<<16|Math.round(blue*255)<<8;}"
|
|
};
|
|
hwbToRgb = hwbToRgb2;
|
|
const parse2552 = function parse255(a0) {
|
|
const r6 = Number.parseInt(a0, 10);
|
|
return r6 < 0 ? 0 : r6 > 255 ? 255 : r6;
|
|
};
|
|
parse2552.__closure = {};
|
|
parse2552.__workletHash = 1908258547020;
|
|
parse2552.__initData = {
|
|
code: "function parse255_Pnpm_ColorsTs4(str){const int=Number.parseInt(str,10);if(int<0){return 0;}if(int>255){return 255;}return int;}"
|
|
};
|
|
parse255 = parse2552;
|
|
const parse3602 = function parse360(a0) {
|
|
return (Number.parseFloat(a0) % 360 + 360) % 360 / 360;
|
|
};
|
|
parse3602.__closure = {};
|
|
parse3602.__workletHash = 15674458953827;
|
|
parse3602.__initData = {
|
|
code: "function parse360_Pnpm_ColorsTs5(str){const int=Number.parseFloat(str);return(int%360+360)%360/360;}"
|
|
};
|
|
parse360 = parse3602;
|
|
const parse12 = function parse1(a0) {
|
|
const r6 = Number.parseFloat(a0);
|
|
return r6 < 0 ? 0 : r6 > 1 ? 255 : Math.round(255 * r6);
|
|
};
|
|
parse12.__closure = {};
|
|
parse12.__workletHash = 1305446443589;
|
|
parse12.__initData = {
|
|
code: "function parse1_Pnpm_ColorsTs6(str){const num=Number.parseFloat(str);if(num<0){return 0;}if(num>1){return 255;}return Math.round(num*255);}"
|
|
};
|
|
parse1 = parse12;
|
|
const parsePercentage2 = function parsePercentage(a0) {
|
|
const r8 = Number.parseFloat(a0);
|
|
return r8 < 0 ? 0 : r8 > 100 ? 1 : r8 / 100;
|
|
};
|
|
parsePercentage2.__closure = {};
|
|
parsePercentage2.__workletHash = 3056354218613;
|
|
parsePercentage2.__initData = {
|
|
code: "function parsePercentage_Pnpm_ColorsTs7(str){const int=Number.parseFloat(str);if(int<0){return 0;}if(int>100){return 1;}return int/100;}"
|
|
};
|
|
parsePercentage = parsePercentage2;
|
|
export function clampRGBA(a0) {
|
|
let r0 = 0;
|
|
while (true) {
|
|
a0[r0] = Math.max(0, Math.min(a0[r0], 1));
|
|
r0 = r0 + 1;
|
|
if (!(r0 < 4)) {
|
|
return void 0;
|
|
}
|
|
}
|
|
}
|
|
clampRGBA.__closure = {};
|
|
clampRGBA.__workletHash = 13575809516663;
|
|
clampRGBA.__initData = {
|
|
code: "function clampRGBA_Pnpm_ColorsTs8(RGBA){for(let i=0;i<4;i++){RGBA[i]=Math.max(0,Math.min(RGBA[i],1));}}"
|
|
};
|
|
c1305_8 = makeShareable({
|
|
transparent: 0,
|
|
aliceblue: 4042850303,
|
|
antiquewhite: 4209760255,
|
|
aqua: 16777215,
|
|
aquamarine: 2147472639,
|
|
azure: 4043309055,
|
|
beige: 4126530815,
|
|
bisque: 4293182719,
|
|
black: 255,
|
|
blanchedalmond: 4293643775,
|
|
blue: 65535,
|
|
blueviolet: 2318131967,
|
|
brown: 2771004159,
|
|
burlywood: 3736635391,
|
|
burntsienna: 3934150143,
|
|
cadetblue: 1604231423,
|
|
chartreuse: 2147418367,
|
|
chocolate: 3530104575,
|
|
coral: 4286533887,
|
|
cornflowerblue: 1687547391,
|
|
cornsilk: 4294499583,
|
|
crimson: 3692313855,
|
|
cyan: 16777215,
|
|
darkblue: 35839,
|
|
darkcyan: 9145343,
|
|
darkgoldenrod: 3095792639,
|
|
darkgray: 2846468607,
|
|
darkgreen: 6553855,
|
|
darkgrey: 2846468607,
|
|
darkkhaki: 3182914559,
|
|
darkmagenta: 2332068863,
|
|
darkolivegreen: 1433087999,
|
|
darkorange: 4287365375,
|
|
darkorchid: 2570243327,
|
|
darkred: 2332033279,
|
|
darksalmon: 3918953215,
|
|
darkseagreen: 2411499519,
|
|
darkslateblue: 1211993087,
|
|
darkslategray: 793726975,
|
|
darkslategrey: 793726975,
|
|
darkturquoise: 13554175,
|
|
darkviolet: 2483082239,
|
|
deeppink: 4279538687,
|
|
deepskyblue: 12582911,
|
|
dimgray: 1768516095,
|
|
dimgrey: 1768516095,
|
|
dodgerblue: 512819199,
|
|
firebrick: 2988581631,
|
|
floralwhite: 4294635775,
|
|
forestgreen: 579543807,
|
|
fuchsia: 4278255615,
|
|
gainsboro: 3705462015,
|
|
ghostwhite: 4177068031,
|
|
gold: 4292280575,
|
|
goldenrod: 3668254975,
|
|
gray: 2155905279,
|
|
green: 8388863,
|
|
greenyellow: 2919182335,
|
|
grey: 2155905279,
|
|
honeydew: 4043305215,
|
|
hotpink: 4285117695,
|
|
indianred: 3445382399,
|
|
indigo: 1258324735,
|
|
ivory: 4294963455,
|
|
khaki: 4041641215,
|
|
lavender: 3873897215,
|
|
lavenderblush: 4293981695,
|
|
lawngreen: 2096890111,
|
|
lemonchiffon: 4294626815,
|
|
lightblue: 2916673279,
|
|
lightcoral: 4034953471,
|
|
lightcyan: 3774873599,
|
|
lightgoldenrodyellow: 4210742015,
|
|
lightgray: 3553874943,
|
|
lightgreen: 2431553791,
|
|
lightgrey: 3553874943,
|
|
lightpink: 4290167295,
|
|
lightsalmon: 4288707327,
|
|
lightseagreen: 548580095,
|
|
lightskyblue: 2278488831,
|
|
lightslategray: 2005441023,
|
|
lightslategrey: 2005441023,
|
|
lightsteelblue: 2965692159,
|
|
lightyellow: 4294959359,
|
|
lime: 16711935,
|
|
limegreen: 852308735,
|
|
linen: 4210091775,
|
|
magenta: 4278255615,
|
|
maroon: 2147483903,
|
|
mediumaquamarine: 1724754687,
|
|
mediumblue: 52735,
|
|
mediumorchid: 3126187007,
|
|
mediumpurple: 2473647103,
|
|
mediumseagreen: 1018393087,
|
|
mediumslateblue: 2070474495,
|
|
mediumspringgreen: 16423679,
|
|
mediumturquoise: 1221709055,
|
|
mediumvioletred: 3340076543,
|
|
midnightblue: 421097727,
|
|
mintcream: 4127193855,
|
|
mistyrose: 4293190143,
|
|
moccasin: 4293178879,
|
|
navajowhite: 4292783615,
|
|
navy: 33023,
|
|
oldlace: 4260751103,
|
|
olive: 2155872511,
|
|
olivedrab: 1804477439,
|
|
orange: 4289003775,
|
|
orangered: 4282712319,
|
|
orchid: 3664828159,
|
|
palegoldenrod: 4008225535,
|
|
palegreen: 2566625535,
|
|
paleturquoise: 2951671551,
|
|
palevioletred: 3681588223,
|
|
papayawhip: 4293907967,
|
|
peachpuff: 4292524543,
|
|
peru: 3448061951,
|
|
pink: 4290825215,
|
|
plum: 3718307327,
|
|
powderblue: 2967529215,
|
|
purple: 2147516671,
|
|
rebeccapurple: 1714657791,
|
|
red: 4278190335,
|
|
rosybrown: 3163525119,
|
|
royalblue: 1097458175,
|
|
saddlebrown: 2336560127,
|
|
salmon: 4202722047,
|
|
sandybrown: 4104413439,
|
|
seagreen: 780883967,
|
|
seashell: 4294307583,
|
|
sienna: 2689740287,
|
|
silver: 3233857791,
|
|
skyblue: 2278484991,
|
|
slateblue: 1784335871,
|
|
slategray: 1887473919,
|
|
slategrey: 1887473919,
|
|
snow: 4294638335,
|
|
springgreen: 16744447,
|
|
steelblue: 1182971135,
|
|
tan: 3535047935,
|
|
teal: 8421631,
|
|
thistle: 3636451583,
|
|
tomato: 4284696575,
|
|
turquoise: 1088475391,
|
|
violet: 4001558271,
|
|
wheat: 4125012991,
|
|
white: 4294967295,
|
|
whitesmoke: 4126537215,
|
|
yellow: 4294902015,
|
|
yellowgreen: 2597139199
|
|
});
|
|
c1305_9 = makeShareable(["backgroundColor", "borderBottomColor", "borderColor", "borderLeftColor", "borderRightColor", "borderTopColor", "borderStartColor", "borderEndColor", "borderBlockColor", "borderBlockEndColor", "borderBlockStartColor", "color", "outlineColor", "shadowColor", "textDecorationColor", "tintColor", "textShadowColor", "overlayColor", "fill", "floodColor", "lightingColor", "stopColor", "stroke"]);
|
|
c1305_10 = makeShareable({
|
|
boxShadow: "color"
|
|
});
|
|
const normalizeColor2 = function normalizeColor(a0) {
|
|
let r10, r11, r136, r340;
|
|
if (typeof a0 === "number") {
|
|
r10 = a0 >>> 0 === a0 ? a0 >= 0 ? a0 <= 4294967295 ? a0 : null : null : null;
|
|
} else {
|
|
r10 = null;
|
|
if (typeof a0 === "string") {
|
|
const r33 = c1305_0.hex6.exec(a0);
|
|
if (r33) {
|
|
r11 = Number.parseInt(r33[1] + "ff", 16) >>> 0;
|
|
} else if (c1305_8[a0] !== void 0) {
|
|
r11 = c1305_8[a0];
|
|
} else {
|
|
const r36 = c1305_0.rgb.exec(a0);
|
|
if (r36) {
|
|
const r408 = Number.parseInt(r36[1], 10);
|
|
const r415 = (r408 < 0 ? 0 : r408 > 255 ? 255 : r408) << 24;
|
|
const r421 = Number.parseInt(r36[2], 10);
|
|
const r427 = (r421 < 0 ? 0 : r421 > 255 ? 255 : r421) << 16;
|
|
const r433 = Number.parseInt(r36[3], 10);
|
|
r11 = (r415 | r427 | (r433 < 0 ? 0 : r433 > 255 ? 255 : r433) << 8 | 255) >>> 0;
|
|
} else {
|
|
const r38 = c1305_0.rgba.exec(a0);
|
|
if (r38) {
|
|
if (r38[6] !== void 0) {
|
|
const r349 = Number.parseInt(r38[6], 10);
|
|
const r356 = (r349 < 0 ? 0 : r349 > 255 ? 255 : r349) << 24;
|
|
const r362 = Number.parseInt(r38[7], 10);
|
|
const r368 = (r362 < 0 ? 0 : r362 > 255 ? 255 : r362) << 16;
|
|
const r374 = Number.parseInt(r38[8], 10);
|
|
const r380 = (r374 < 0 ? 0 : r374 > 255 ? 255 : r374) << 8;
|
|
const r387 = Number.parseFloat(r38[9]);
|
|
r340 = (r356 | r368 | r380 | (r387 < 0 ? 0 : r387 > 1 ? 255 : Math.round(255 * r387))) >>> 0;
|
|
} else {
|
|
const r289 = Number.parseInt(r38[2], 10);
|
|
const r296 = (r289 < 0 ? 0 : r289 > 255 ? 255 : r289) << 24;
|
|
const r302 = Number.parseInt(r38[3], 10);
|
|
const r308 = (r302 < 0 ? 0 : r302 > 255 ? 255 : r302) << 16;
|
|
const r314 = Number.parseInt(r38[4], 10);
|
|
const r320 = (r314 < 0 ? 0 : r314 > 255 ? 255 : r314) << 8;
|
|
const r327 = Number.parseFloat(r38[5]);
|
|
r340 = (r296 | r308 | r320 | (r327 < 0 ? 0 : r327 > 1 ? 255 : Math.round(255 * r327))) >>> 0;
|
|
}
|
|
r11 = r340;
|
|
} else {
|
|
const r40 = c1305_0.hex3.exec(a0);
|
|
if (r40) {
|
|
r11 = Number.parseInt(r40[1] + r40[1] + r40[2] + r40[2] + r40[3] + r40[3] + "ff", 16) >>> 0;
|
|
} else {
|
|
const r42 = c1305_0.hex8.exec(a0);
|
|
if (r42) {
|
|
r11 = Number.parseInt(r42[1], 16) >>> 0;
|
|
} else {
|
|
const r44 = c1305_0.hex4.exec(a0);
|
|
if (r44) {
|
|
r11 = Number.parseInt(r44[1] + r44[1] + r44[2] + r44[2] + r44[3] + r44[3] + r44[4] + r44[4], 16) >>> 0;
|
|
} else {
|
|
const r24 = c1305_0.hsl.exec(a0);
|
|
if (r24) {
|
|
const r202 = Number.parseFloat(r24[1]) % 360;
|
|
const r209 = Number.parseFloat(r24[2]);
|
|
const r212 = r209 < 0 ? 0 : r209 > 100 ? 1 : r209 / 100;
|
|
const r221 = Number.parseFloat(r24[3]);
|
|
r11 = (255 | hslToRgb((r202 + 360) % 360 / 360, r212, r221 < 0 ? 0 : r221 > 100 ? 1 : r221 / 100)) >>> 0;
|
|
} else {
|
|
const r48 = c1305_0.hsla.exec(a0);
|
|
if (r48) {
|
|
if (r48[6] !== void 0) {
|
|
const r147 = Number.parseFloat(r48[6]) % 360;
|
|
const r154 = Number.parseFloat(r48[7]);
|
|
const r157 = r154 < 0 ? 0 : r154 > 100 ? 1 : r154 / 100;
|
|
const r166 = Number.parseFloat(r48[8]);
|
|
const r174 = hslToRgb((r147 + 360) % 360 / 360, r157, r166 < 0 ? 0 : r166 > 100 ? 1 : r166 / 100);
|
|
const r181 = Number.parseFloat(r48[9]);
|
|
r136 = (r174 | (r181 < 0 ? 0 : r181 > 1 ? 255 : Math.round(255 * r181))) >>> 0;
|
|
} else {
|
|
const r90 = Number.parseFloat(r48[2]) % 360;
|
|
const r97 = Number.parseFloat(r48[3]);
|
|
const r100 = r97 < 0 ? 0 : r97 > 100 ? 1 : r97 / 100;
|
|
const r109 = Number.parseFloat(r48[4]);
|
|
const r118 = hslToRgb((r90 + 360) % 360 / 360, r100, r109 < 0 ? 0 : r109 > 100 ? 1 : r109 / 100);
|
|
const r125 = Number.parseFloat(r48[5]);
|
|
r136 = (r118 | (r125 < 0 ? 0 : r125 > 1 ? 255 : Math.round(255 * r125))) >>> 0;
|
|
}
|
|
r11 = r136;
|
|
} else {
|
|
const r26 = c1305_0.hwb.exec(a0);
|
|
r11 = null;
|
|
if (r26) {
|
|
const r0 = Number.parseFloat(r26[1]) % 360;
|
|
const r61 = Number.parseFloat(r26[2]);
|
|
const r3 = r61 < 0 ? 0 : r61 > 100 ? 1 : r61 / 100;
|
|
const r68 = Number.parseFloat(r26[3]);
|
|
r11 = (255 | hwbToRgb((r0 + 360) % 360 / 360, r3, r68 < 0 ? 0 : r68 > 100 ? 1 : r68 / 100)) >>> 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
r10 = r11;
|
|
}
|
|
}
|
|
return r10;
|
|
};
|
|
normalizeColor2.__closure = {
|
|
MATCHERS: c1305_0,
|
|
names: c1305_8,
|
|
parse255,
|
|
parse1,
|
|
hslToRgb,
|
|
parse360,
|
|
parsePercentage,
|
|
hwbToRgb
|
|
};
|
|
normalizeColor2.__workletHash = 13656798455904;
|
|
normalizeColor2.__initData = {
|
|
code: "function normalizeColor_Pnpm_ColorsTs9(color){const{MATCHERS,names,parse255,parse1,hslToRgb,parse360,parsePercentage,hwbToRgb}=this.__closure;if(typeof color==='number'){if(color>>>0===color&&color>=0&&color<=0xffffffff){return color;}return null;}if(typeof color!=='string'){return null;}let match;if(match=MATCHERS.hex6.exec(color)){return Number.parseInt(match[1]+'ff',16)>>>0;}if(names[color]!==undefined){return names[color];}if(match=MATCHERS.rgb.exec(color)){return((parse255(match[1])<<24|parse255(match[2])<<16|parse255(match[3])<<8|0x000000ff)>>>0);}if(match=MATCHERS.rgba.exec(color)){if(match[6]!==undefined){return(parse255(match[6])<<24|parse255(match[7])<<16|parse255(match[8])<<8|parse1(match[9]))>>>0;}return(parse255(match[2])<<24|parse255(match[3])<<16|parse255(match[4])<<8|parse1(match[5]))>>>0;}if(match=MATCHERS.hex3.exec(color)){return Number.parseInt(match[1]+match[1]+match[2]+match[2]+match[3]+match[3]+'ff',16)>>>0;}if(match=MATCHERS.hex8.exec(color)){return Number.parseInt(match[1],16)>>>0;}if(match=MATCHERS.hex4.exec(color)){return Number.parseInt(match[1]+match[1]+match[2]+match[2]+match[3]+match[3]+match[4]+match[4],16)>>>0;}if(match=MATCHERS.hsl.exec(color)){return(hslToRgb(parse360(match[1]),parsePercentage(match[2]),parsePercentage(match[3]))|0x000000ff)>>>0;}if(match=MATCHERS.hsla.exec(color)){if(match[6]!==undefined){return(hslToRgb(parse360(match[6]),parsePercentage(match[7]),parsePercentage(match[8]))|parse1(match[9]))>>>0;}return(hslToRgb(parse360(match[2]),parsePercentage(match[3]),parsePercentage(match[4]))|parse1(match[5]))>>>0;}if(match=MATCHERS.hwb.exec(color)){return(hwbToRgb(parse360(match[1]),parsePercentage(match[2]),parsePercentage(match[3]))|0x000000ff)>>>0;}return null;}"
|
|
};
|
|
normalizeColor = normalizeColor2;
|
|
const t = function t(a0) {
|
|
return (a0 >> 24 & 255) / 255;
|
|
};
|
|
t.__closure = {};
|
|
t.__workletHash = 5651263271273;
|
|
t.__initData = {
|
|
code: "function pnpm_ColorsTs10(c){return(c>>24&255)/255;}"
|
|
};
|
|
const n = function n(a0) {
|
|
return a0 >> 16 & 255;
|
|
};
|
|
n.__closure = {};
|
|
n.__workletHash = 10831766115157;
|
|
n.__initData = {
|
|
code: "function pnpm_ColorsTs11(c){return c>>16&255;}"
|
|
};
|
|
const a = function a(a0) {
|
|
return a0 >> 8 & 255;
|
|
};
|
|
a.__closure = {};
|
|
a.__workletHash = 3551227549865;
|
|
a.__initData = {
|
|
code: "function pnpm_ColorsTs12(c){return c>>8&255;}"
|
|
};
|
|
const l = function l(a0) {
|
|
return 255 & a0;
|
|
};
|
|
l.__closure = {};
|
|
l.__workletHash = 8634480727248;
|
|
l.__initData = {
|
|
code: "function pnpm_ColorsTs13(c){return c&255;}"
|
|
};
|
|
const r153 = function(a0, a1, a2, r2 = 1) {
|
|
return `rgba(${a0}, ${a1}, ${a2}, ${r2 < 0.001 ? 0 : r2})`;
|
|
};
|
|
r153.__closure = {};
|
|
r153.__workletHash = 14577013878569;
|
|
r153.__initData = {
|
|
code: "function pnpm_ColorsTs14(r,g,b,alpha=1){const safeAlpha=alpha<0.001?0:alpha;return\"rgba(\"+r+\", \"+g+\", \"+b+\", \"+safeAlpha+\")\";}"
|
|
};
|
|
s2 = r153;
|
|
export function RGBtoHSV(a0, a1, a2) {
|
|
const r13 = Math.max(a0, a1, a2);
|
|
const r12 = Math.min(a0, a1, a2);
|
|
const r16 = r13 - r12;
|
|
return {
|
|
h: r12 !== r13 ? a0 === r13 ? (a1 - a2 + r16 * (a1 < a2 ? 6 : 0)) / (6 * r16) : a1 === r13 ? (a2 - a0 + 2 * r16) / (6 * r16) : a2 === r13 ? (a0 - a1 + 4 * r16) / (6 * r16) : 0 : 0,
|
|
s: r13 !== 0 ? r16 / r13 : 0,
|
|
v: r13 / 255
|
|
};
|
|
}
|
|
RGBtoHSV.__closure = {};
|
|
RGBtoHSV.__workletHash = 13961093508129;
|
|
RGBtoHSV.__initData = {
|
|
code: "function RGBtoHSV_Pnpm_ColorsTs15(r,g,b){const max=Math.max(r,g,b);const min=Math.min(r,g,b);const d=max-min;const s=max===0?0:d/max;const v=max/255;let h=0;switch(max){case min:break;case r:h=g-b+d*(g<b?6:0);h/=6*d;break;case g:h=b-r+d*2;h/=6*d;break;case b:h=r-g+d*4;h/=6*d;break;}return{h:h,s:s,v:v};}"
|
|
};
|
|
const HSVtoRGB2 = function HSVtoRGB(a0, a1, a2) {
|
|
let r13, r28, r30;
|
|
const r14 = Math.floor(6 * a0);
|
|
const r16 = 6 * a0 - r14;
|
|
const r17 = a2 * (1 - a1);
|
|
const r19 = a2 * (1 - r16 * a1);
|
|
const r23 = a2 * (1 - (1 - r16) * a1);
|
|
const r24 = r14 % 6;
|
|
if (r24 === 0) {
|
|
r28 = r17;
|
|
r30 = r23;
|
|
r13 = a2;
|
|
} else if (r24 === 1) {
|
|
r28 = r17;
|
|
r30 = a2;
|
|
r13 = r19;
|
|
} else if (r24 === 2) {
|
|
r28 = r23;
|
|
r30 = a2;
|
|
r13 = r17;
|
|
} else if (r24 === 3) {
|
|
r28 = a2;
|
|
r30 = r19;
|
|
r13 = r17;
|
|
} else if (r24 === 4) {
|
|
r28 = a2;
|
|
r30 = r17;
|
|
r13 = r23;
|
|
} else {
|
|
r28 = void 0;
|
|
r30 = void 0;
|
|
r13 = void 0;
|
|
if (r24 === 5) {
|
|
r28 = r19;
|
|
r30 = r17;
|
|
r13 = a2;
|
|
}
|
|
}
|
|
return {
|
|
r: Math.round(255 * r13),
|
|
g: Math.round(255 * r30),
|
|
b: Math.round(255 * r28)
|
|
};
|
|
};
|
|
HSVtoRGB2.__closure = {};
|
|
HSVtoRGB2.__workletHash = 5232397720804;
|
|
HSVtoRGB2.__initData = {
|
|
code: "function HSVtoRGB_Pnpm_ColorsTs16(h,s,v){let r,g,b;const i=Math.floor(h*6);const f=h*6-i;const p=v*(1-s);const q=v*(1-f*s);const t=v*(1-(1-f)*s);switch(i%6){case 0:[r,g,b]=[v,t,p];break;case 1:[r,g,b]=[q,v,p];break;case 2:[r,g,b]=[p,v,t];break;case 3:[r,g,b]=[p,q,v];break;case 4:[r,g,b]=[t,p,v];break;case 5:[r,g,b]=[v,p,q];break;}return{r:Math.round(r*255),g:Math.round(g*255),b:Math.round(b*255)};}"
|
|
};
|
|
HSVtoRGB = HSVtoRGB2;
|
|
const c = function c(a0, a1, a2, a3) {
|
|
let r39, r41, r42;
|
|
const r26 = Math.floor(6 * a0);
|
|
const r0 = 6 * a0 - r26;
|
|
const r29 = a2 * (1 - a1);
|
|
const r31 = a2 * (1 - r0 * a1);
|
|
const r35 = a2 * (1 - (1 - r0) * a1);
|
|
const r5 = r26 % 6;
|
|
if (r5 === 0) {
|
|
r39 = r29;
|
|
r41 = r35;
|
|
r42 = a2;
|
|
} else if (r5 === 1) {
|
|
r39 = r29;
|
|
r41 = a2;
|
|
r42 = r31;
|
|
} else if (r5 === 2) {
|
|
r39 = r35;
|
|
r41 = a2;
|
|
r42 = r29;
|
|
} else if (r5 === 3) {
|
|
r39 = a2;
|
|
r41 = r31;
|
|
r42 = r29;
|
|
} else if (r5 === 4) {
|
|
r39 = a2;
|
|
r41 = r29;
|
|
r42 = r35;
|
|
} else {
|
|
r39 = void 0;
|
|
r41 = void 0;
|
|
r42 = void 0;
|
|
if (r5 === 5) {
|
|
r39 = r31;
|
|
r41 = r29;
|
|
r42 = a2;
|
|
}
|
|
}
|
|
const r47 = Math.round(255 * r42);
|
|
const r51 = Math.round(255 * r41);
|
|
const r55 = Math.round(255 * r39);
|
|
const r59 = a3 === void 0 ? 1 : a3;
|
|
return `rgba(${r47}, ${r51}, ${r55}, ${r59 < 0.001 ? 0 : r59})`;
|
|
};
|
|
c.__closure = {
|
|
HSVtoRGB,
|
|
rgbaColor: s2
|
|
};
|
|
c.__workletHash = 16564231422584;
|
|
c.__initData = {
|
|
code: "function pnpm_ColorsTs17(h,s,v,a){const{HSVtoRGB,rgbaColor}=this.__closure;const{r:r,g:g,b:b}=HSVtoRGB(h,s,v);return rgbaColor(r,g,b,a);}"
|
|
};
|
|
const processColorInitially2 = function processColorInitially(a0) {
|
|
if (a0 == null) {
|
|
return a0;
|
|
}
|
|
let r6 = a0;
|
|
if (typeof a0 !== "number") {
|
|
const r9 = normalizeColor(a0);
|
|
if (r9 == null) {
|
|
return void 0;
|
|
}
|
|
r6 = r9;
|
|
if (typeof r6 !== "number") {
|
|
return null;
|
|
}
|
|
}
|
|
return (r6 << 24 | r6 >>> 8) >>> 0;
|
|
};
|
|
processColorInitially2.__closure = {
|
|
normalizeColor
|
|
};
|
|
processColorInitially2.__workletHash = 7970244905356;
|
|
processColorInitially2.__initData = {
|
|
code: "function processColorInitially_Pnpm_ColorsTs18(color){const{normalizeColor}=this.__closure;if(color===null||color===undefined){return color;}let colorNumber;if(typeof color==='number'){colorNumber=color;}else{const normalizedColor=normalizeColor(color);if(normalizedColor===null||normalizedColor===undefined){return undefined;}if(typeof normalizedColor!=='number'){return null;}colorNumber=normalizedColor;}return(colorNumber<<24|colorNumber>>>8)>>>0;}"
|
|
};
|
|
processColorInitially = processColorInitially2;
|
|
export function isColor(a0) {
|
|
let r13;
|
|
let r3 = typeof a0 === "string";
|
|
if (typeof a0 === "string") {
|
|
L8: {
|
|
r13 = a0;
|
|
if (a0 != null) {
|
|
let r8 = a0;
|
|
if (typeof a0 !== "number") {
|
|
const r15 = normalizeColor(a0);
|
|
const r6 = r15 == null;
|
|
r13 = void 0;
|
|
if (r6) {
|
|
break L8;
|
|
}
|
|
r13 = null;
|
|
r8 = r15;
|
|
if (typeof r8 !== "number") {
|
|
break L8;
|
|
}
|
|
}
|
|
r13 = (r8 << 24 | r8 >>> 8) >>> 0;
|
|
}
|
|
}
|
|
r3 = r13 != null;
|
|
}
|
|
return r3;
|
|
}
|
|
isColor.__closure = {
|
|
processColorInitially
|
|
};
|
|
isColor.__workletHash = 13504829084422;
|
|
isColor.__initData = {
|
|
code: "function isColor_Pnpm_ColorsTs19(value){const{processColorInitially}=this.__closure;if(typeof value!=='string'){return false;}return processColorInitially(value)!=null;}"
|
|
};
|
|
isAndroid = _Module1609.isAndroid();
|
|
const processColor2 = function processColor(current) {
|
|
let r7;
|
|
L7: {
|
|
r7 = current;
|
|
if (current != null) {
|
|
let r8 = current;
|
|
if (typeof current !== "number") {
|
|
const r14 = normalizeColor(current);
|
|
const r4 = r14 == null;
|
|
r7 = void 0;
|
|
if (r4) {
|
|
break L7;
|
|
}
|
|
r7 = null;
|
|
r8 = r14;
|
|
if (typeof r8 !== "number") {
|
|
break L7;
|
|
}
|
|
}
|
|
r7 = (r8 << 24 | r8 >>> 8) >>> 0;
|
|
}
|
|
}
|
|
if (r7 != null) {
|
|
return typeof r7 === "number" ? isAndroid ? r7 | 0 : r7 : null;
|
|
}
|
|
};
|
|
processColor2.__closure = {
|
|
processColorInitially,
|
|
IS_ANDROID: isAndroid
|
|
};
|
|
processColor2.__workletHash = 850613387330;
|
|
processColor2.__initData = {
|
|
code: "function processColor_Pnpm_ColorsTs20(color){const{processColorInitially,IS_ANDROID}=this.__closure;let normalizedColor=processColorInitially(color);if(normalizedColor===null||normalizedColor===undefined){return undefined;}if(typeof normalizedColor!=='number'){return null;}if(IS_ANDROID){normalizedColor=normalizedColor|0x0;}return normalizedColor;}"
|
|
};
|
|
processColor = processColor2;
|
|
export function processColorsInProps(a0) {
|
|
for (const key in a0) {
|
|
if (c1305_9.includes(key)) {
|
|
if (Array.isArray(a0[key])) {
|
|
a0[key] = a0[key].map((item) => {
|
|
let r8;
|
|
L9: {
|
|
r8 = item;
|
|
if (item != null) {
|
|
let r16 = item;
|
|
if (typeof item !== "number") {
|
|
const r17 = normalizeColor(item);
|
|
const r4 = r17 == null;
|
|
r8 = void 0;
|
|
if (r4) {
|
|
break L9;
|
|
}
|
|
r8 = null;
|
|
r16 = r17;
|
|
if (typeof r16 !== "number") {
|
|
break L9;
|
|
}
|
|
}
|
|
r8 = (r16 << 24 | r16 >>> 8) >>> 0;
|
|
}
|
|
}
|
|
return r8 != null ? typeof r8 === "number" ? isAndroid ? r8 | 0 : r8 : null : void 0;
|
|
});
|
|
} else {
|
|
a0[key] = processColor(a0[key]);
|
|
}
|
|
} else if (c1305_10[key]) {
|
|
for (const item of a0[key]) {
|
|
const r39 = c1305_10[key];
|
|
if (item[r39] !== void 0) {
|
|
item[r39] = processColor(item[r39]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
processColorsInProps.__closure = {
|
|
ColorProperties: c1305_9,
|
|
processColor,
|
|
NestedColorProperties: c1305_10
|
|
};
|
|
processColorsInProps.__workletHash = 978448002474;
|
|
processColorsInProps.__initData = {
|
|
code: "function processColorsInProps_Pnpm_ColorsTs21(props){const{ColorProperties,processColor,NestedColorProperties}=this.__closure;for(const key in props){if(ColorProperties.includes(key)){if(Array.isArray(props[key])){props[key]=props[key].map(function(color){return processColor(color);});}else{props[key]=processColor(props[key]);}}else if(NestedColorProperties[key]){const propGroupList=props[key];for(const propGroup of propGroupList){const nestedPropertyName=NestedColorProperties[key];if(propGroup[nestedPropertyName]!==undefined){propGroup[nestedPropertyName]=processColor(propGroup[nestedPropertyName]);}}}}}"
|
|
};
|
|
export function convertToRGBA(a0) {
|
|
let r7;
|
|
L7: {
|
|
r7 = a0;
|
|
if (a0 != null) {
|
|
let r12 = a0;
|
|
if (typeof a0 !== "number") {
|
|
const r14 = normalizeColor(a0);
|
|
const r5 = r14 == null;
|
|
r7 = void 0;
|
|
if (r5) {
|
|
break L7;
|
|
}
|
|
r7 = null;
|
|
r12 = r14;
|
|
if (typeof r12 !== "number") {
|
|
break L7;
|
|
}
|
|
}
|
|
r7 = (r12 << 24 | r12 >>> 8) >>> 0;
|
|
}
|
|
}
|
|
return [(r7 << 8 >>> 24) / 255, (r7 << 16 >>> 24) / 255, (r7 << 24 >>> 24) / 255, (r7 >>> 24) / 255];
|
|
}
|
|
convertToRGBA.__closure = {
|
|
processColorInitially
|
|
};
|
|
convertToRGBA.__workletHash = 15503083969849;
|
|
convertToRGBA.__initData = {
|
|
code: "function convertToRGBA_Pnpm_ColorsTs22(color){const{processColorInitially}=this.__closure;const processedColor=processColorInitially(color);const a=(processedColor>>>24)/255;const r=(processedColor<<8>>>24)/255;const g=(processedColor<<16>>>24)/255;const b=(processedColor<<24>>>24)/255;return[r,g,b,a];}"
|
|
};
|
|
export function rgbaArrayToRGBAColor(a0) {
|
|
const r10 = a0[3] < 0.001 ? 0 : a0[3];
|
|
return `rgba(${Math.round(255 * a0[0])}, ${Math.round(255 * a0[1])}, ${Math.round(255 * a0[2])}, ${r10})`;
|
|
}
|
|
rgbaArrayToRGBAColor.__closure = {};
|
|
rgbaArrayToRGBAColor.__workletHash = 9717764015913;
|
|
rgbaArrayToRGBAColor.__initData = {
|
|
code: "function rgbaArrayToRGBAColor_Pnpm_ColorsTs23(RGBA){const alpha=RGBA[3]<0.001?0:RGBA[3];return\"rgba(\"+Math.round(RGBA[0]*255)+\", \"+Math.round(RGBA[1]*255)+\", \"+Math.round(RGBA[2]*255)+\", \"+alpha+\")\";}"
|
|
};
|
|
export function toLinearSpace(a0, r8 = 2.2) {
|
|
const r5 = [];
|
|
let r0 = 0;
|
|
while (true) {
|
|
r5.push(Math.pow(a0[r0], r8));
|
|
r0 = r0 + 1;
|
|
if (!(r0 < 3)) {
|
|
r5.push(a0[3]);
|
|
return r5;
|
|
}
|
|
}
|
|
}
|
|
toLinearSpace.__closure = {};
|
|
toLinearSpace.__workletHash = 2672100143834;
|
|
toLinearSpace.__initData = {
|
|
code: "function toLinearSpace_Pnpm_ColorsTs24(RGBA,gamma=2.2){const res=[];for(let i=0;i<3;++i){res.push(Math.pow(RGBA[i],gamma));}res.push(RGBA[3]);return res;}"
|
|
};
|
|
export function toGammaSpace(a0, r8 = 2.2) {
|
|
const r5 = [];
|
|
let r0 = 0;
|
|
while (true) {
|
|
r5.push(Math.pow(a0[r0], 1 / r8));
|
|
r0 = r0 + 1;
|
|
if (!(r0 < 3)) {
|
|
r5.push(a0[3]);
|
|
return r5;
|
|
}
|
|
}
|
|
}
|
|
toGammaSpace.__closure = {};
|
|
toGammaSpace.__workletHash = 1726439203743;
|
|
toGammaSpace.__initData = {
|
|
code: "function toGammaSpace_Pnpm_ColorsTs25(RGBA,gamma=2.2){const res=[];for(let i=0;i<3;++i){res.push(Math.pow(RGBA[i],1/gamma));}res.push(RGBA[3]);return res;}"
|
|
};
|
|
export { c1305_9 as ColorProperties };
|
|
export { normalizeColor };
|
|
export { t as opacity };
|
|
export { n as red };
|
|
export { a as green };
|
|
export { l as blue };
|
|
export { s2 as rgbaColor };
|
|
export { c as hsvToColor };
|
|
export { processColorInitially };
|
|
export { processColor };
|