diff --git a/src/app/BackgroundSelect.svelte b/src/app/BackgroundSelect.svelte index c1e3047..2f58d38 100644 --- a/src/app/BackgroundSelect.svelte +++ b/src/app/BackgroundSelect.svelte @@ -3,6 +3,7 @@ export let value export let colors + export let aliases const parseColor = x => { if (typeof x === 'string') return parseColor({ value: x }) @@ -14,11 +15,26 @@ } $: _colors = [{ value: '@none', label: '' }, ...colors].map(parseColor) + + $: selected = _colors.find(x => x.value === value) + + const optionsAliases = { + '@none': '#fff', + } + + const renderBg = (value, isOptions) => { + if (!value) return 'background: #fff' + const bg = (isOptions && optionsAliases[value]) || aliases[value] || value + return `background: ${bg}` + } - + {#each _colors as { value, label, dark, optionStyle } (value)} + {/each} @@ -28,6 +44,12 @@ font-family: monospace; color: #333; } + select { + color: transparent; + height: 22px; + width: 42px; + border-color: #c0c0c0; + } .dark { color: #eee; } diff --git a/src/app/Toolbar.svelte b/src/app/Toolbar.svelte index 563d808..99cd430 100644 --- a/src/app/Toolbar.svelte +++ b/src/app/Toolbar.svelte @@ -27,15 +27,17 @@ Outline -