zed/styles/theme-tool/app/page.tsx
Nate Butler 42b5fa1fa3 WIP: Use algorithm to generate reference color palette
Adapted from @k-vyn/coloralgorithm
Generate colors for our reference palette.
2023-02-09 12:37:05 -05:00

68 lines
1.7 KiB
TypeScript

/* eslint-disable import/no-relative-packages */
import { Scale } from 'chroma-js';
import { color } from '../../src/system/reference';
function ColorChips({ colorScale }: { colorScale: Scale }) {
const colors = colorScale.colors(11);
return (
<div
style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
gap: '1px',
}}
>
{colors.map((c) => (
<div
key={c}
style={{
backgroundColor: c,
width: '80px',
height: '40px',
}}
>
{c}
</div>
))}
</div>
);
}
export default function Home() {
const {
grayLight,
grayDark,
roseDark,
roseLight,
redDark,
redLight,
orangeDark,
orangeLight,
amberDark,
amberLight,
} = color;
return (
<main>
<div style={{ display: 'flex', gap: '1px' }}>
<ColorChips colorScale={grayLight} />
<ColorChips colorScale={grayDark} />
<ColorChips colorScale={roseLight} />
<ColorChips colorScale={roseDark} />
<ColorChips colorScale={redLight} />
<ColorChips colorScale={redDark} />
<ColorChips colorScale={orangeLight} />
<ColorChips colorScale={orangeDark} />
<ColorChips colorScale={amberLight} />
<ColorChips colorScale={amberDark} />
</div>
</main>
);
}