UNPKG

welcome-ui

Version:

Customizable design system with react • styled-components • styled-system and ariakit.

12 lines (11 loc) 489 B
"use client"; const s = (t, n, o) => parseInt(t.substring(n, o), 16), c = (t) => /(^[0-9a-fA-F]{6}$)|(^[0-9a-fA-F]{3}$)/.test(t), i = (t) => { if (!t || (t = t.replace("#", ""), !c(t))) return; t.length === 3 && (t = `${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}`); const n = (r) => s(r, 0, 2), o = (r) => s(r, 2, 4), $ = (r) => s(r, 4, 6); return `${n(t)}, ${o(t)}, ${$(t)}`; }, a = (t, n = 1) => t ? t.startsWith("#") ? `rgba(${i(t)}, ${n})` : t : void 0; export { a as h };