platypush/platypush/backend/http/webapp/dist/static/js/747.21f6bf7b.js

2 lines
30 KiB
JavaScript
Raw Normal View History

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