import { useRef } from 'react' import { BookOpen, History, Image } from 'lucide-react' import { useStudioPalette } from './paint/paletteModel' import '../../styles/studio-paint.css' /** * The colour picker, shared by everything in the inspector that has a colour. * * Its own file because both the plain elements and the travel elements need it, * and the second copy of a swatch row is how two parts of one panel end up * offering different palettes. * * The palette is print ink rather than app chrome — it does not follow the * user's theme, because a book is printed once and read on paper, where an * accent chosen for a dark interface means nothing. * * Under the fixed inks sit up to three short rows from the open book * (paint/StudioPalette.tsx): the colours the book already uses, the colours * of the photos on this page, and what this person picked lately. Each row * is there only when it has something in it, so a new book shows the inks * alone, as before. */ const SWATCHES = [ '#111111', '#ffffff', '#8a8578', '#c2410c', '#b45309', '#0f766e', '#1e3a8a', '#9f1239', '#4c1d95', ] function Swatch({ color, on, onPick }: { color: string; on: boolean; onPick: (c: string) => void }) { return (