import { For, splitProps, mergeProps, createMemo } from 'solid-js'; export default function ColorPicker(props) { const merged = mergeProps({ value: '', colors: ['#6366f1', '#10b981', '#f59e0b', '#1f2937'] }, props); const [local, others] = splitProps(merged, ['value', 'onInput', 'class', 'colors']); const colors = local.colors; const isCustomColor = createMemo(() => { return !colors.includes(local.value?.toLowerCase()); }); const select = (color) => { local.onInput?.(color); }; return (