const b=(t,n)=>{const e=Math.pow(10,n);return Math.round((t+Number.EPSILON)*e)/e},m=t=>t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");function x(t,n,e){return t<=e&&n>=e}function M(t,n,e){const r=e-t,o=Math.round(r/(n-t)*1e4)/1e4;return Math.max(0,Math.min(1,o))}let d=0;function T(t="id"){return`${t}-${d++}`}function w(t){if(!t||!/^#[0-9A-F]{3,6}$/i.test(t))return null;let n=0,e=0,r=0;return t.length===4?(n=parseInt(t.substring(1,2).repeat(2),16),e=parseInt(t.substring(2,3).repeat(2),16),r=parseInt(t.substring(3,4).repeat(2),16)):t.length===7&&(n=parseInt(t.substring(1,3),16),e=parseInt(t.substring(3,5),16),r=parseInt(t.substring(5,7),16)),{r:n,g:e,b:r}}function B(t){let n=0,e=0,r=0;const o=t[1]||"0",c=t[2]||"0",g=t[3]||"0",h=t[4]||"0",f=t[5]||"0",I=t[6]||"0";if(t.length==4)n=parseInt(o+o,16),e=parseInt(c+c,16),r=parseInt(g+g,16);else if(t.length==7)n=parseInt(o+c,16),e=parseInt(g+h,16),r=parseInt(f+I,16);else throw new Error("Invalid hex color format");n/=255,e/=255,r/=255;const p=Math.min(n,e,r),l=Math.max(n,e,r),a=l-p;let s=0,u=0,i=0;return a==0?s=0:l==n?s=(e-r)/a%6:l==e?s=(r-n)/a+2:s=(n-e)/a+4,s=Math.round(s*60),s<0&&(s+=360),i=(l+p)/2,u=a==0?0:a/(1-math.abs(2*i-1)),u=+(u*100).tofixed(1),i=+(i*100).tofixed(1),{h:s,s:u,l:i}}export{w as a,x as b,m as f,T as g,B as h,M as i,b as r};

AltStyle によって変換されたページ (->オリジナル) /