diff --git a/pages/themer.tsx b/pages/themer.tsx index 7682c06a..dd243d62 100644 --- a/pages/themer.tsx +++ b/pages/themer.tsx @@ -29,13 +29,22 @@ export default function Themer() {
{Object.entries(palette).map(([key, value]) => { + const color = + value.length === 4 && value.startsWith("#") + ? `#${value[1].repeat(2)}${value[2].repeat(2)}${value[3].repeat( + 2 + )}` + : value; + + const isValidColor = color.startsWith("#") && color.length === 7; + return (
context?.setTheme({ [key]: event.target.value }) } @@ -50,11 +59,13 @@ export default function Themer() {