feat: add color picker

This commit is contained in:
2026-08-23 06:12:37 +05:00
parent 3701fc8045
commit 7b799969c4
6 changed files with 162 additions and 43 deletions
@@ -10,9 +10,11 @@
onFile: (file: File) => void;
onError: (message: string) => void;
onReset: () => void;
pipetteActive?: boolean;
onPickColor?: (hex: string) => void;
}
let { source, onFile, onError, onReset }: Props = $props();
let { source, onFile, onError, onReset, pipetteActive = false, onPickColor }: Props = $props();
</script>
<div class="container">
@@ -22,7 +24,7 @@
{:else}
<DropOverlay {onFile} {onError}>
<div class="media">
<Preview image={source} />
<Preview image={source} pipetteActive={pipetteActive} onPickColor={onPickColor} />
</div>
<Button variant="secondary" onclick={onReset}>Заменить изображение</Button>
</DropOverlay>