// Module ID: 1804 // Function ID: 1805 // Dependencies: [1805, 1679, 1806, 1647, 1788, 1680] // Exports: interpolateColor, useInterpolateConfig // Module 1804 import _mod1647 from "module_1647" /* 1647 */; import _mod1679 from "module_1679" /* 1679 */; import runOnRuntime from "runOnRuntime" /* 1680 */; import _mod1788 from "module_1788" /* 1788 */; import _mod1805 from "module_1805" /* 1805 */; import convertLrgbToOklabDefault from "convertLrgbToOklab" /* 1806 */; const interpolateColorsHSV = function o(arg0, arg1, h, useCorrectedHSVInterpolation) { useCorrectedHSVInterpolation = useCorrectedHSVInterpolation.useCorrectedHSVInterpolation; if (undefined !== useCorrectedHSVInterpolation) { if (!useCorrectedHSVInterpolation) { const obj = _mod1805; let interpolateResult = obj.interpolate(arg0, arg1, h.h, _mod1805.Extrapolation.CLAMP); } const tmpResult = _mod1805; const interpolateResult1 = tmpResult.interpolate(arg0, arg1, h.s, _mod1805.Extrapolation.CLAMP); const tmpResult4 = _mod1805; const interpolateResult2 = tmpResult4.interpolate(arg0, arg1, h.v, _mod1805.Extrapolation.CLAMP); const tmpResult5 = _mod1805; const tmpResult6 = _mod1679; return tmpResult6.hsvToColor(interpolateResult, interpolateResult1, interpolateResult2, tmpResult5.interpolate(arg0, arg1, h.a, _mod1805.Extrapolation.CLAMP)); } const items = [arg1[0]]; h = h.h; const items1 = [h[0]]; let num = 1; if (1 < h.length) { while (true) { let diff = num - 1; let diff1 = h[num] - h[diff]; if (h[num] > h[diff]) { if (diff1 > 0.5) { let arr = items.push(arg1[num]); let arr2 = items.push(arg1[num] + 0.00001); let arr3 = items1.push(h[num] - 1); let arr13 = items1.push(h[num]); num = num + 1; if (num >= h.length) { break; } } } if (h[num] < h[diff]) { if (diff1 < -0.5) { let arr14 = items.push(arg1[num]); let arr15 = items.push(arg1[num] + 0.00001); let arr16 = items1.push(h[num] + 1); let arr17 = items1.push(h[num]); } } let arr18 = items.push(arg1[num]); let arr19 = items1.push(h[num]); } } interpolateResult = (_mod1805.interpolate(arg0, items, items1, _mod1805.Extrapolation.CLAMP) + 1) % 1; }; interpolateColorsHSV.__closure = { interpolate: _mod1805.interpolate, Extrapolation: _mod1805.Extrapolation, hsvToColor: _mod1679.hsvToColor }; interpolateColorsHSV.__workletHash = 1574790978150; interpolateColorsHSV.__initData = { code: "function pnpm_interpolateColorTs1(value,inputRange,colors,options){const{interpolate,Extrapolation,hsvToColor}=this.__closure;let h=0;const{useCorrectedHSVInterpolation=true}=options;if(useCorrectedHSVInterpolation){const correctedInputRange=[inputRange[0]];const originalH=colors.h;const correctedH=[originalH[0]];for(let i=1;ioriginalH[i-1]&&d>0.5){correctedInputRange.push(inputRange[i]);correctedInputRange.push(inputRange[i]+0.00001);correctedH.push(originalH[i]-1);correctedH.push(originalH[i]);}else if(originalH[i] Math.pow(item / 255, num)); }; fn2.__closure = {}; fn2.__workletHash = 16826369876333; fn2.__initData = { code: "function pnpm_interpolateColorTs2(x,gamma){return x.map(function(v){return Math.pow(v/255,gamma);});}" }; const fn3 = function r(sum, arg1) { return Math.round(255 * Math.pow(sum, 1 / arg1)); }; fn3.__closure = {}; fn3.__workletHash = 5856560656141; fn3.__initData = { code: "function pnpm_interpolateColorTs3(x,gamma){return Math.round(Math.pow(x,1/gamma)*255);}" }; const fn4 = function a(arg0, arg1, arg2, gamma) { gamma = gamma.gamma; let num = 2.2; if (undefined !== gamma) { num = gamma; } ({ r, g, b } = arg2); let mapped = b; let tmp2 = g; let tmp3 = r; if (1 !== num) { if (typeof fn2 === "function") { if (typeof tmp25 === "function") { if (typeof tmp25 === "function") { mapped = b.map((item) => Math.pow(item / 255, num)); tmp2 = tmp5; tmp3 = tmp4; } else { throw new TypeError("Trying to call a non-function"); } } else { throw new TypeError("Trying to call a non-function"); } } else { throw new TypeError("Trying to call a non-function"); } } const interpolateResult = _mod1805.interpolate(arg0, arg1, tmp3, _mod1805.Extrapolation.CLAMP); const interpolateResult1 = _mod1805.interpolate(arg0, arg1, tmp2, _mod1805.Extrapolation.CLAMP); const interpolateResult2 = _mod1805.interpolate(arg0, arg1, mapped, _mod1805.Extrapolation.CLAMP); const interpolateResult3 = _mod1805.interpolate(arg0, arg1, arg2.a, _mod1805.Extrapolation.CLAMP); if (1 === num) { const tmp6Result = tmp6(1679); let rgbaColorResult = tmp6Result.rgbaColor(interpolateResult, interpolateResult1, interpolateResult2, interpolateResult3); } else { if (typeof fn3 === "function") { const _Math = Math; const _Math2 = Math; const rounded = Math.round(255 * Math.pow(interpolateResult, 1 / num)); if (typeof tmp28 === "function") { const _Math3 = Math; const _Math4 = Math; const rounded1 = Math.round(255 * Math.pow(interpolateResult1, 1 / num)); if (typeof tmp28 === "function") { const _Math5 = Math; const _Math6 = Math; rgbaColorResult = tmp27(rounded, rounded1, Math.round(255 * Math.pow(interpolateResult2, 1 / num)), interpolateResult3); } else { throw new TypeError("Trying to call a non-function"); } } else { throw new TypeError("Trying to call a non-function"); } } else { throw new TypeError("Trying to call a non-function"); } const tmp6Result2 = tmp6(1679); } return rgbaColorResult; }; let obj = { interpolate: _mod1805.interpolate, Extrapolation: _mod1805.Extrapolation, hsvToColor: _mod1679.hsvToColor }; fn4.__closure = { toLinearSpace: fn2, interpolate: _mod1805.interpolate, Extrapolation: _mod1805.Extrapolation, rgbaColor: _mod1679.rgbaColor, toGammaSpace: fn3 }; fn4.__workletHash = 13883480600753; fn4.__initData = { code: "function pnpm_interpolateColorTs4(value,inputRange,colors,options){const{toLinearSpace,interpolate,Extrapolation,rgbaColor,toGammaSpace}=this.__closure;const{gamma=2.2}=options;let{r:outputR,g:outputG,b:outputB}=colors;if(gamma!==1){outputR=toLinearSpace(outputR,gamma);outputG=toLinearSpace(outputG,gamma);outputB=toLinearSpace(outputB,gamma);}const r=interpolate(value,inputRange,outputR,Extrapolation.CLAMP);const g=interpolate(value,inputRange,outputG,Extrapolation.CLAMP);const b=interpolate(value,inputRange,outputB,Extrapolation.CLAMP);const a=interpolate(value,inputRange,colors.a,Extrapolation.CLAMP);if(gamma===1){return rgbaColor(r,g,b,a);}return rgbaColor(toGammaSpace(r,gamma),toGammaSpace(g,gamma),toGammaSpace(b,gamma),a);}" }; const fn5 = function n(arg0, arg1, l, arg3) { const interpolateResult = _mod1805.interpolate(arg0, arg1, l.l, _mod1805.Extrapolation.CLAMP); const interpolateResult1 = _mod1805.interpolate(arg0, arg1, l.a, _mod1805.Extrapolation.CLAMP); const interpolateResult2 = _mod1805.interpolate(arg0, arg1, l.b, _mod1805.Extrapolation.CLAMP); const convert = convertLrgbToOklabDefault.oklab.convert; const interpolateResult3 = _mod1805.interpolate(arg0, arg1, l.alpha, _mod1805.Extrapolation.CLAMP); ({ r, g, b, alpha } = convert.toRgb({ l: interpolateResult, a: interpolateResult1, b: interpolateResult2, alpha: _mod1805.interpolate(arg0, arg1, l.alpha, _mod1805.Extrapolation.CLAMP) })); const toRgbResult = convert.toRgb({ l: interpolateResult, a: interpolateResult1, b: interpolateResult2, alpha: _mod1805.interpolate(arg0, arg1, l.alpha, _mod1805.Extrapolation.CLAMP) }); return _mod1679.rgbaColor(r, g, b, alpha); }; let obj2 = { toLinearSpace: fn2, interpolate: _mod1805.interpolate, Extrapolation: _mod1805.Extrapolation, rgbaColor: _mod1679.rgbaColor, toGammaSpace: fn3 }; fn5.__closure = { interpolate: _mod1805.interpolate, Extrapolation: _mod1805.Extrapolation, culori: convertLrgbToOklabDefault, rgbaColor: _mod1679.rgbaColor }; fn5.__workletHash = 7788654685113; fn5.__initData = { code: "function pnpm_interpolateColorTs5(value,inputRange,colors,_options){const{interpolate,Extrapolation,culori,rgbaColor}=this.__closure;const l=interpolate(value,inputRange,colors.l,Extrapolation.CLAMP);const a=interpolate(value,inputRange,colors.a,Extrapolation.CLAMP);const b=interpolate(value,inputRange,colors.b,Extrapolation.CLAMP);const alpha=interpolate(value,inputRange,colors.alpha,Extrapolation.CLAMP);const{r:_r,g:_g,b:_b,alpha:_alpha}=culori.oklab.convert.toRgb({l:l,a:a,b:b,alpha:alpha});return rgbaColor(_r,_g,_b,_alpha);}" }; const fn6 = function l(arg0, fn) { const ch1 = []; const ch2 = []; const ch3 = []; const alpha = []; for (let num = 0; num < arg0.length; num = num + 1) { let tmp = require; let obj = _mod1679; let processColorResult = obj.processColor(arg0[num]); if (typeof processColorResult === "number") { let obj2 = { r: null, g: null, b: null }; let tmpResult = tmp(1679); obj2.r = tmpResult.red(processColorResult); let tmpResult4 = tmp(1679); obj2.g = tmpResult4.green(processColorResult); let tmpResult5 = tmp(1679); obj2.b = tmpResult5.blue(processColorResult); let tmp5 = fn(obj2); let arr = ch1.push(tmp5.ch1); let arr2 = ch2.push(tmp5.ch2); let arr3 = ch3.push(tmp5.ch3); let tmpResult6 = tmp(1679); let arr4 = alpha.push(tmpResult6.opacity(processColorResult)); } } return { ch1, ch2, ch3, alpha }; }; const color = { processColor: _mod1679.processColor, red: _mod1679.red, green: _mod1679.green, blue: _mod1679.blue, opacity: _mod1679.opacity }; fn6.__closure = color; fn6.__workletHash = 8764168362190; fn6.__initData = { code: "function pnpm_interpolateColorTs6(colors,convFromRgb){const{processColor,red,green,blue,opacity}=this.__closure;const ch1=[];const ch2=[];const ch3=[];const alpha=[];for(let i=0;i ({ ch1: ch1.r, ch2: ch1.g, ch3: ch1.b })); return { r: tmp.ch1, g: tmp.ch2, b: tmp.ch3, a: tmp.alpha }; }; fn7.__closure = { _splitColorsIntoChannels: fn6 }; fn7.__workletHash = 937749076324; fn7.__initData = { code: "function pnpm_interpolateColorTs7(colors){const{_splitColorsIntoChannels}=this.__closure;const{ch1:ch1,ch2:ch2,ch3:ch3,alpha:alpha}=_splitColorsIntoChannels(colors,function(color){return{ch1:color.r,ch2:color.g,ch3:color.b};});return{r:ch1,g:ch2,b:ch3,a:alpha};}" }; const fn8 = function p(arg0) { const tmp = fn6(arg0, (arg0) => { const RGBtoHSVResult = _mod1679.RGBtoHSV(arg0.r, arg0.g, arg0.b); return { ch1: RGBtoHSVResult.h, ch2: RGBtoHSVResult.s, ch3: RGBtoHSVResult.v }; }); return { h: tmp.ch1, s: tmp.ch2, v: tmp.ch3, a: tmp.alpha }; }; let obj3 = { interpolate: _mod1805.interpolate, Extrapolation: _mod1805.Extrapolation, culori: convertLrgbToOklabDefault, rgbaColor: _mod1679.rgbaColor }; fn8.__closure = { _splitColorsIntoChannels: fn6, RGBtoHSV: _mod1679.RGBtoHSV }; fn8.__workletHash = 11798906675452; fn8.__initData = { code: "function pnpm_interpolateColorTs8(colors){const{_splitColorsIntoChannels,RGBtoHSV}=this.__closure;const{ch1:ch1,ch2:ch2,ch3:ch3,alpha:alpha}=_splitColorsIntoChannels(colors,function(color){const hsvColor=RGBtoHSV(color.r,color.g,color.b);return{ch1:hsvColor.h,ch2:hsvColor.s,ch3:hsvColor.v};});return{h:ch1,s:ch2,v:ch3,a:alpha};}" }; const fn9 = function i(arg0) { const tmp = fn6(arg0, (arg0) => { const convert = convertLrgbToOklabDefault.oklab.convert; const fromRgbResult = convert.fromRgb(arg0); return { ch1: fromRgbResult.l, ch2: fromRgbResult.a, ch3: fromRgbResult.b }; }); return { l: tmp.ch1, a: tmp.ch2, b: tmp.ch3, alpha: tmp.alpha }; }; let obj4 = { _splitColorsIntoChannels: fn6, RGBtoHSV: _mod1679.RGBtoHSV }; fn9.__closure = { _splitColorsIntoChannels: fn6, culori: convertLrgbToOklabDefault }; fn9.__workletHash = 11214827752418; fn9.__initData = { code: "function pnpm_interpolateColorTs9(colors){const{_splitColorsIntoChannels,culori}=this.__closure;const{ch1:ch1,ch2:ch2,ch3:ch3,alpha:alpha}=_splitColorsIntoChannels(colors,function(color){const labColor=culori.oklab.convert.fromRgb(color);return{ch1:labColor.l,ch2:labColor.a,ch3:labColor.b};});return{l:ch1,a:ch2,b:ch3,alpha:alpha};}" }; function interpolateColor(arg0, arg1, arg2) { let str = arg3; if (arg3 === undefined) { str = "RGB"; } let obj = arg4; if (arg4 === undefined) { obj = {}; } if ("HSV" === str) { if (typeof fn8 === "function") { const obj7 = { h: null, s: null, v: null, a: null }; ({ ch1: obj4.h, ch2: obj4.s, ch3: obj4.v, alpha: obj4.a } = fn6(arg2, (arg0) => { const RGBtoHSVResult = _mod1679.RGBtoHSV(arg0.r, arg0.g, arg0.b); return { ch1: RGBtoHSVResult.h, ch2: RGBtoHSVResult.s, ch3: RGBtoHSVResult.v }; })); return tmp24(arg0, arg1, obj7, obj); } else { throw new TypeError("Trying to call a non-function"); } } else if ("RGB" === str) { if (typeof fn7 === "function") { const obj8 = { r: null, g: null, b: null, a: null }; ({ ch1: obj3.r, ch2: obj3.g, ch3: obj3.b, alpha: obj3.a } = fn6(arg2, (ch1) => ({ ch1: ch1.r, ch2: ch1.g, ch3: ch1.b }))); return tmp16(arg0, arg1, obj8, obj); } else { throw new TypeError("Trying to call a non-function"); } } else if ("LAB" === str) { if (typeof fn9 === "function") { const obj9 = { l: null, a: null, b: null, alpha: null }; ({ ch1: obj2.l, ch2: obj2.a, ch3: obj2.b, alpha: obj2.alpha } = fn6(arg2, (arg0) => { const convert = convertLrgbToOklabDefault.oklab.convert; const fromRgbResult = convert.fromRgb(arg0); return { ch1: fromRgbResult.l, ch2: fromRgbResult.a, ch3: fromRgbResult.b }; })); return tmp8(arg0, arg1, obj9, obj); } else { throw new TypeError("Trying to call a non-function"); } } else { const _HermesInternal = HermesInternal; const reanimatedError = new _mod1647.ReanimatedError("Invalid color space provided: " + str + ". Supported values are: ['RGB', 'HSV', 'LAB']."); throw reanimatedError; } } interpolateColor.__closure = { interpolateColorsHSV, getInterpolateHSV: fn8, interpolateColorsRGB: fn4, getInterpolateRGB: fn7, interpolateColorsLAB: fn5, getInterpolateLAB: fn9 }; interpolateColor.__workletHash = 10004340589678; interpolateColor.__initData = { code: "function interpolateColor_Pnpm_interpolateColorTs10(value,inputRange,outputRange,colorSpace='RGB',options={}){const{interpolateColorsHSV,getInterpolateHSV,interpolateColorsRGB,getInterpolateRGB,interpolateColorsLAB,getInterpolateLAB}=this.__closure;if(colorSpace==='HSV'){return interpolateColorsHSV(value,inputRange,getInterpolateHSV(outputRange),options);}else if(colorSpace==='RGB'){return interpolateColorsRGB(value,inputRange,getInterpolateRGB(outputRange),options);}else if(colorSpace==='LAB'){return interpolateColorsLAB(value,inputRange,getInterpolateLAB(outputRange),options);}throw new ReanimatedError(\"Invalid color space provided: \"+colorSpace+\". Supported values are: ['RGB', 'HSV', 'LAB'].\");}" }; const obj6 = { RGB: 0, [0]: "RGB", HSV: 1, [1]: "HSV", LAB: 2, [2]: "LAB" }; export const Extrapolate = _mod1805.Extrapolation; export { interpolateColor }; export const ColorSpace = obj6; export const useInterpolateConfig = function useInterpolateConfig(inputRange, outputRange) { let RGB = arg2; if (arg2 === undefined) { RGB = obj6.RGB; } let obj = arg3; if (arg3 === undefined) { obj = {}; } const obj3 = { inputRange, outputRange, colorSpace: RGB, cache: null, options: null }; const obj2 = _mod1788; obj3.cache = runOnRuntime.makeMutable(null); obj3.options = obj; return obj2.useSharedValue(obj3); };