platypush/platypush/backend/http/webapp/dist/static/js/4604.ac359b97.js

2 lines
35 KiB
JavaScript
Raw Normal View History

2022-03-30 01:43:59 +02:00
"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[4604],{4212:function(e,t,s){s.d(t,{N:function(){return a}});class a{constructor(e){if(this.ranges={hue:[0,360],sat:[0,100],bri:[0,100],ct:[154,500]},e)for(const t of Object.keys(this.ranges))e[t]&&(this.ranges[t]=e[t])}normalize(e,t,s){return s[0]+(e-t[0])*(s[1]-s[0])/(t[1]-t[0])}hslToRgb(e,t,s){[e,t,s]=[this.normalize(e,this.ranges.hue,[0,360]),this.normalize(t,this.ranges.sat,[0,100]),this.normalize(s,this.ranges.bri,[0,100])],s/=100;const a=t*Math.min(s,1-s)/100,i=t=>{const i=(t+e/30)%12,n=s-a*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*n)};return[i(0),i(8),i(4)]}rgbToHsl(e,t,s){e/=255,t/=255,s/=255;const a=Math.max(e,t,s),i=Math.min(e,t,s);let n,l,o=(a+i)/2;if(a===i)n=l=0;else{const r=a-i;switch(l=o>.5?r/(2-a-i):r/(a+i),a){case e:n=(t-s)/r+(t<s?6:0);break;case t:n=(s-e)/r+2;break;case s:n=(e-t)/r+4;break}n/=6}return[parseInt(this.normalize(n,[0,1],this.ranges.hue)),parseInt(this.normalize(l,[0,1],this.ranges.sat)),parseInt(this.normalize(o,[0,1],this.ranges.bri))]}xyToRgb(e,t,s){null==s&&(s=this.ranges.bri[1]);const a=1-e-t,i=(s/(this.ranges.bri[1]-1)).toFixed(2),n=i/t*e,l=i/t*a;let o=1.656492*n-.354851*i-.255038*l,r=.707196*-n+1.655397*i+.036152*l,d=.051713*n-.121364*i+1.01153*l;return o>d&&o>r&&o>1?(r/=o,d/=o,o=1):r>d&&r>o&&r>1?(o/=r,d/=r,r=1):d>o&&d>r&&d>1&&(o/=d,r/=d,d=1),o=o<=.0031308?12.92*o:1.055*Math.pow(o,1/2.4)-.055,r=r<=.0031308?12.92*r:1.055*Math.pow(r,1/2.4)-.055,d=d<=.0031308?12.92*d:1.055*Math.pow(d,1/2.4)-.055,o=Math.round(255*o),r=Math.round(255*r),d=Math.round(255*d),isNaN(o)&&(o=0),isNaN(r)&&(r=0),isNaN(d)&&(d=0),[o,r,d].map((e=>Math.min(Math.max(0,e),255)))}rgbToXY(e,t,s){e>1&&(e/=255),t>1&&(t/=255),s>1&&(s/=255),e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;const a=.664511*e+.154324*t+.162028*s,i=.283881*e+.668433*t+.047685*s,n=88e-6*e+.07231*t+.986039*s;let l=parseFloat((a/(a+i+n)).toFixed(4)),o=parseFloat((i/(a+i+n)).toFixed(4));return isNaN(l)&&(l=0),isNaN(o)&&(o=0),[l,o]}rgbToBri(e,t,s){return Math.min(2*this.rgbToHsl(e,t,s)[2],this.ranges.bri[1])}getRGB(e){return null!=e.red&&null!=e.green&&null!=e.blue?[e.red,e.green,e.blue]:null!=e.r&&null!=e.g&&null!=e.b?[e.r,e.g,e.b]:e.rgb?e.rgb:void 0}getXY(e){return null!=e.x&&null!=e.y?[e.x,e.y]:e.xy?e.xy:void 0}toRGB(e){const t=this.getRGB(e);if(t)return t;const s=this.getXY(e);return s&&e.bri?this.xyToRgb(...s,e.bri):e.hue&&e.sat&&e.bri?this.hslToRgb(e.hue,e.sat,e.bri):(console.debug("Could not determine color space"),void console.debug(e))}toXY(e){const t=this.getXY(e);if(t&&e.bri)return[t[0],t[1],e.bri];const s=this.getRGB(e);if(s)return this.rgbToXY(...s);if(e.hue&&e.sat&&e.bri){const t=this.hslToRgb(e.hue,e.sat,e.bri);return this.rgbToXY(...t)}console.debug("Could not determine color space"),console.debug(e)}toHSL(e){if(e.hue&&e.sat&&e.bri)return[e.hue,e.sat,e.bri];const t=this.getRGB(e);if(t)return this.rgbToHsl(...t);const s=this.getXY(e);if(s&&e.bri){const t=this.xyToRgb(...s,e.bri);return this.rgbToHsl(...t)}console.debug("Could not determine color space"),console.debug(e)}}},1120:function(e,t,s){s.d(t,{Z:function(){return g}});var a=s(6252),i=s(9963),n=s(3577);const l={class:"slider-wrapper"},o=["min","max","step","disabled","value"],r={class:"track"},d={class:"track-inner",ref:"track"},u={class:"thumb",ref:"thumb"},c=["textContent"];function v(e,t,s,v,p,h){return(0,a.wg)(),(0,a.iD)("label",l,[(0,a._)("input",{class:"slider",type:"range",ref:"range",min:s.range[0],max:s.range[1],step:s.step,disabled:s.disabled,value:s.value,onInput:t[0]||(t[0]=(0,i.iM)(((...e)=>h.onUpdate&&h.onUpdate(...e)),["stop"])),onChange:t[1]||(t[1]=(0,i.iM)(((...e)=>h.onUpdate&&h.onUpdate(...e)),["stop"])),onMouseup:t[2]||(t[2]=(0,i.iM)(((...e)=>h.onUpdate&&h.onUpdate(...e)),["stop"])),onMousedown:t[3]||(t[3]=(0,i.iM)(((...e)=>h.onUpdate&&h.onUpdate(...e)),["stop"])),onTouchstart:t[4]||(t[4]=(0,i.iM)(((...e)=>h.onUpdate&&h.onUpdate(...e)),["stop"])),onTouchend:t[5]||(t[5]=(0
//# sourceMappingURL=4604.ac359b97.js.map