diff --git a/README.md b/README.md index c076c7a0..f0b41378 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,6 @@ First time you start it up you should also run `yarn prep data` # General Todos - [ ] Its really annoying to have to update schema, types, docs whenever a lang change is made. Can this be automated? -- [ ] Color Space selections should persist - [ ] Make name discrim hueristc fix more resilient, see switching to basic colors - [ ] Search palettes-by-lint screen - [ ] Drag to re-order points? @@ -47,6 +46,7 @@ First time you start it up you should also run `yarn prep data` - [ ] Allow no palettes - [ ] allows renaming of non-current palettes - [ ] Parameterize the scatter column completely, allow edits to the compare stuff +- [x] Color Space selections should persist - [x] Dont allow saves to examples when there's an error - [x] Switch the examples to be tabs or single - [x] Consider moving the names and color chunks into the left hand column for space diff --git a/src/components/ColorChannelPicker.svelte b/src/components/ColorChannelPicker.svelte index 0a88adeb..13e788fc 100644 --- a/src/components/ColorChannelPicker.svelte +++ b/src/components/ColorChannelPicker.svelte @@ -1,4 +1,6 @@
- { + // @ts-ignore + configStore.setChannelPickerSpace(e.currentTarget.value); + }} + > {#each [...Object.keys(colorConfigs)] as colorMode} {/each} @@ -161,7 +170,7 @@ {channel.name} ({channel.min}-{channel.max}) import focusStore from "../stores/focus-store"; import type { Palette } from "../types"; - import Tooltip from "./Tooltip.svelte"; - import SwatchTooltipContent from "./SwatchTooltipContent.svelte"; - import { toggleElement } from "../lib/utils"; export let pal: Palette; export let allowModification: boolean = false; export let highlightSelected: boolean = false; - $: focusColors = $focusStore.focusedColors; + import { dealWithFocusEvent } from "../lib/utils"; + $: focusSet = new Set($focusStore.focusedColors); @@ -21,32 +19,17 @@ > {#each pal.colors as color, idx} {#if allowModification} - -
- -
- -
+ {:else}
- import ColorChannelPicker from "./ColorChannelPicker.svelte"; - import { Color } from "../lib/Color"; - import colorStore from "../stores/color-store"; - import focusStore from "../stores/focus-store"; - import { buttonStyle } from "../lib/styles"; - export let idx: number; - export let color: Color; - export let closeTooltip: () => void; - $: currentPal = $colorStore.palettes[$colorStore.currentPal]; - $: colors = currentPal.colors; - $: colorSpace = currentPal.colorSpace; - - function updateColor(color: Color) { - const updatedColors = [...colors]; - updatedColors[idx] = color; - colorStore.setCurrentPalColors(updatedColors); - } - $: modes = ( - colorSpace === "hsv" ? ["hsv", "lab"] : [colorSpace, "hsv"] - ) as any; - - -
-
- { - // @ts-ignore - updateColor(Color.colorFromString(e.target.value, colorSpace)); - }} - /> - - - -
-
- {#each modes as colorMode, jdx} -
- { - const updatedColors = [...colors]; - updatedColors[idx] = color; - colorStore.setCurrentPalColors(updatedColors); - }} - /> -
- {/each} -
-
- - diff --git a/src/content-modules/Controls.svelte b/src/content-modules/Controls.svelte index 2df65e2c..28fb5f2f 100644 --- a/src/content-modules/Controls.svelte +++ b/src/content-modules/Controls.svelte @@ -1,6 +1,10 @@ -
+
Color Buddy 𑁍
diff --git a/src/example/Example.svelte b/src/example/Example.svelte index c0dee6f9..5bdf145d 100644 --- a/src/example/Example.svelte +++ b/src/example/Example.svelte @@ -3,8 +3,6 @@ import colorStore from "../stores/color-store"; import configStore from "../stores/config-store"; import { Color } from "../lib/Color"; - import Tooltip from "../components/Tooltip.svelte"; - import SwatchTooltipContent from "../components/SwatchTooltipContent.svelte"; import focusStore from "../stores/focus-store"; import { idxToKey } from "../lib/charts"; import simulate_cvd from "../lib/blindness"; @@ -101,25 +99,6 @@
{@html insertColorsToExample(example, mappedColors, bg.toHex(), size)}
- {#if color && focusedColor !== false} - { - focusStore.clearColors(); - focusedColor = false; - }} - > -
- -
-
- {/if}