import {a as a$1,b}from'./chunk-IOXRZECH.mjs';var h=Array.from({length:256},(t,r)=>r.toString(16).padStart(2,"0")),n=t=>h[a$1(Math.round(t),0,255)],s=t=>(t&15)+9*(t>>6),a=(t,r)=>s(t.charCodeAt(r))<<4|s(t.charCodeAt(r+1)),i=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,p=t=>{if(typeof t!="string")return null;let r=t.trim();if(!i.test(r))return null;let o=r.length;if(o===4||o===5){let e=s(r.charCodeAt(1)),c=s(r.charCodeAt(2)),b$1=s(r.charCodeAt(3)),l=o===5?s(r.charCodeAt(4)):15;return {r:e|e<<4,g:c|c<<4,b:b$1|b$1<<4,alpha:b((l|l<<4)/255,3)}}return {r:a(r,1),g:a(r,3),b:a(r,5),alpha:o===9?b(a(r,7)/255,3):1}},x=({r:t,g:r,b:o,alpha:e})=>{let c="#"+n(t)+n(r)+n(o);return e<1?c+n(e*255):c},f=({r:t,g:r,b:o,alpha:e})=>"#"+n(t)+n(r)+n(o)+n(e*255);export{n as a,p as b,x as c,f as d};//# sourceMappingURL=chunk-RJNXPIQM.mjs.map
//# sourceMappingURL=chunk-RJNXPIQM.mjs.map