Skip to content

Commit 9d35919

Browse files
authored
Merge pull request #292 from pathsim/fix/color-palette-icon
Use Lucide palette icon for color picker
2 parents 1bf2aff + 5a4cea8 commit 9d35919

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

src/lib/components/dialogs/shared/ColorPicker.svelte

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script lang="ts">
22
import { tooltip } from '$lib/components/Tooltip.svelte';
3+
import Icon from '$lib/components/icons/Icon.svelte';
34
import { DIALOG_COLOR_PALETTE, DEFAULT_NODE_COLOR } from '$lib/utils/colors';
45
56
interface Props {
@@ -49,13 +50,9 @@
4950

5051
<div class="color-picker-wrapper" data-tour="block-color-picker">
5152
<button class="picker-btn" class:ghost={variant === 'ghost'} onclick={toggle} aria-label="Change color" use:tooltip={{ text: 'Color', position: tooltipPosition }}>
52-
<svg width={iconSize} height={iconSize} viewBox="0 0 24 24" fill="none" stroke={iconColor || 'currentColor'} stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
53-
<circle cx="12" cy="12" r="10"/>
54-
<circle cx="8" cy="10" r="1.5" fill={iconColor || 'currentColor'}/>
55-
<circle cx="12" cy="7" r="1.5" fill={iconColor || 'currentColor'}/>
56-
<circle cx="16" cy="10" r="1.5" fill={iconColor || 'currentColor'}/>
57-
<circle cx="15" cy="15" r="2" fill={iconColor || 'currentColor'}/>
58-
</svg>
53+
<span class="icon-wrap" style={iconColor ? `color: ${iconColor};` : ''}>
54+
<Icon name="palette" size={iconSize} />
55+
</span>
5956
</button>
6057
{#if isOpen}
6158
<!-- svelte-ignore a11y_click_events_have_key_events -->
@@ -119,6 +116,10 @@
119116
color: var(--text);
120117
}
121118
119+
.icon-wrap {
120+
display: inline-flex;
121+
}
122+
122123
/* Ghost variant for annotation nodes - minimal styling */
123124
.picker-btn.ghost {
124125
width: auto;

src/lib/components/icons/Icon.svelte

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@
8585
<line x1="12" y1="17" x2="12" y2="22"/>
8686
<path d="M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z"/>
8787
</svg>
88+
{:else if name === 'palette'}
89+
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
90+
<path d="M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z"/>
91+
<circle cx="13.5" cy="6.5" r=".5" fill="currentColor"/>
92+
<circle cx="17.5" cy="10.5" r=".5" fill="currentColor"/>
93+
<circle cx="6.5" cy="12.5" r=".5" fill="currentColor"/>
94+
<circle cx="8.5" cy="7.5" r=".5" fill="currentColor"/>
95+
</svg>
8896
{:else if name === 'pin-filled'}
8997
<svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
9098
<line x1="12" y1="17" x2="12" y2="22"/>

0 commit comments

Comments
 (0)