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