diff --git a/src/page-components/auto-palette/PaletteColors.tsx b/src/page-components/auto-palette/PaletteColors.tsx
new file mode 100644
index 0000000..cd99a17
--- /dev/null
+++ b/src/page-components/auto-palette/PaletteColors.tsx
@@ -0,0 +1,55 @@
+import { useMemo } from 'react';
+import { useColorFunction } from '../../ColorFunctionContext';
+import { FlexColorStand } from '../../components/FlexColorStand';
+
+type PaletteColorsProps = {
+ color: string;
+ swatchAmount: number;
+ referenceBias: number;
+ useReference: boolean;
+ min: number;
+ max: number;
+ copyMode: 'hex' | 'rgb' | 'hsl' | 'lab' | 'oklch';
+};
+
+export function PaletteColors({
+ color = '000000',
+ swatchAmount,
+ referenceBias,
+ useReference,
+ min,
+ max,
+ copyMode,
+}: PaletteColorsProps) {
+ const { colorFn } = useColorFunction();
+ const colors = useMemo(() => {
+ if (!colorFn) {
+ return Array.from({ length: swatchAmount }, () => color);
+ }
+ try {
+ if (!useReference) {
+ return colorFn.generate_palette_from_color(color, swatchAmount, min, max);
+ } else {
+ return colorFn.generate_palette_from_color(
+ color,
+ swatchAmount,
+ min,
+ max,
+ useReference,
+ referenceBias,
+ );
+ }
+ } catch (e) {
+ console.error('[Generate Auto Palette]', e);
+ }
+ return Array.from({ length: swatchAmount }, () => color);
+ }, [color, swatchAmount, referenceBias, useReference, min, max]);
+
+ return (
+ <>
+ {colors.map((c, index) => (
+
+ ))}
+ >
+ );
+}
diff --git a/src/pages/Palette.module.css b/src/pages/Palette.module.css
index 54a8322..27489c1 100644
--- a/src/pages/Palette.module.css
+++ b/src/pages/Palette.module.css
@@ -43,5 +43,13 @@
gap: var(--spacing-s);
font-size: var(--font-size-s);
}
+ .colors_booth {
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+ align-items: stretch;
+ gap: var(--spacing-xs);
+ min-height: 12em;
+ }
}
}
diff --git a/src/pages/Palette.tsx b/src/pages/Palette.tsx
index dac505b..bf1861f 100644
--- a/src/pages/Palette.tsx
+++ b/src/pages/Palette.tsx
@@ -7,6 +7,7 @@ import { Labeled } from '../components/Labeled';
import { LabeledPicker } from '../components/LabeledPicker';
import { ScrollArea } from '../components/ScrollArea';
import { Switch } from '../components/Switch';
+import { PaletteColors } from '../page-components/auto-palette/PaletteColors';
import { currentPickedColor } from '../stores/colors';
import styles from './Palette.module.css';
@@ -53,14 +54,14 @@ export function AutomaticPalette() {
setSwatchAmount(value)}
/>
Generated Palette
+