You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
918 B
2 lines
918 B
const t=new Map,e="#05c9ac";function n(n){const i=function(t){if(!t||"string"!=typeof t)return e;let n=t.trim();if(n.startsWith("#")||(n=`#${n}`),/^#[0-9A-Fa-f]{6}$/.test(n))return n;if(/^#[0-9A-Fa-f]{3}$/.test(n)){const t=n[1],e=n[2],i=n[3];return`#${t}${t}${e}${e}${i}${i}`}return e}(n||"");if(t.has(i))return t.get(i);if("undefined"==typeof document)return t.set(i,""),"";const f=document.createElement("canvas");f.width=48,f.height=56;const a=f.getContext("2d");if(!a)return t.set(i,""),"";const l=24;a.clearRect(0,0,48,56),a.beginPath(),a.arc(l,18,14,0,2*Math.PI),a.fillStyle="#ffffff",a.fill(),a.beginPath(),a.arc(l,18,12,0,2*Math.PI),a.fillStyle=i,a.fill(),a.beginPath(),a.moveTo(16,28),a.lineTo(l,50),a.lineTo(32,28),a.closePath(),a.fillStyle=i,a.fill(),a.beginPath(),a.arc(21,15,3,0,2*Math.PI),a.fillStyle="rgba(255,255,255,0.35)",a.fill();const r=f.toDataURL("image/png");return t.set(i,r),r}export{n as g};
|