UNPKG

carbon-react

Version:

A library of reusable React components for easily building user interfaces.

2 lines (1 loc) 371 B
const t=t=>parseInt(t,16);var a=(a,e,r=50)=>{const[n,p]=((...t)=>t.map((t=>t.replace(/#/,""))).map((t=>(t=>3===t.length)(t)?t.repeat(2):t)))(a,e),o=n.match(/.{1,2}/g),c=p.match(/.{1,2}/g);return c?`#${null==o?void 0:o.reduce(((a,e,n)=>{const p=t(e),o=t(c[n]);return a+Math.round(o+r/100*(p-o)).toString(16).padStart(2,"0")}),"").toUpperCase()}`:""};export{a as default};