function t(t){if(!t||"string"!=typeof t)return!1;const e=document.createElement("canvas").getContext("2d"),n=e.fillStyle;e.fillStyle=t;if(n===e.fillStyle)return!1;return!["inherit","transparent","initial","unset","currentColor"].includes(t.toLowerCase())}function e(t,e=.3){const n=document.createElement("div");n.style.color=t,document.body.appendChild(n);const o=getComputedStyle(n).color;document.body.removeChild(n);const r=o.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(!r)return t;let[d,a,c,l]=r.map(Number);return a=Math.max(0,Math.round(a*(1-e))),c=Math.max(0,Math.round(c*(1-e))),l=Math.max(0,Math.round(l*(1-e))),`rgb(${a}, ${c}, ${l})`}function n(t,e=.15){const n=document.createElement("div");n.style.color=t,document.body.appendChild(n);const o=getComputedStyle(n).color;document.body.removeChild(n);const r=o.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(!r)return`rgba(0,0,0,${e})`;const[d,a,c,l]=r;return`rgba(${a}, ${c}, ${l}, ${e})`}export{e as d,n as g,t as i};
