feat(saju-ui-v2): _shell/helpers — hexA/daeunLabel/deriveTraits/colorMap + tests

This commit is contained in:
2026-05-27 01:58:26 +09:00
parent 7f42c40efc
commit 47b5eab3ff
5 changed files with 115 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
export default function hexA(hex, alpha) {
const h = hex.replace('#', '');
const expanded = h.length === 3 ? h.split('').map((c) => c + c).join('') : h;
const n = parseInt(expanded, 16);
return `rgba(${(n >> 16) & 255},${(n >> 8) & 255},${n & 255},${alpha})`;
}