diff --git a/src/components/PalPreview.svelte b/src/components/PalPreview.svelte index 1fd89fec..0b26325d 100644 --- a/src/components/PalPreview.svelte +++ b/src/components/PalPreview.svelte @@ -4,6 +4,7 @@ export let pal: Palette; export let allowModification: boolean = false; export let highlightSelected: boolean = false; + export let showTags: boolean = false; import { dealWithFocusEvent } from "../lib/utils"; @@ -18,25 +19,34 @@ on:click={() => focusStore.clearColors()} > {#each pal.colors as color, idx} - {#if allowModification} - - {:else} -
- {/if} +
+ {#if allowModification} + + {:else} +
+ {/if} + {#if showTags} +
+ {#each pal.colorSemantics[idx].tags as tag} + {tag} + {/each} +
+ {/if} +
{/each} diff --git a/src/content-modules/Browse.svelte b/src/content-modules/Browse.svelte index 5b6e2f2b..172d5348 100644 --- a/src/content-modules/Browse.svelte +++ b/src/content-modules/Browse.svelte @@ -205,7 +205,9 @@
Colors
-
{pal.palette.colors.map((x) => x.toHex()).join(", ")}
+
+ {pal.palette.colors.map((x) => x.color.toHex()).join(", ")} +
Controls
+
+ {/each} + +
Object for this color
+ + +
Size of color
+ diff --git a/src/controls/Config.svelte b/src/controls/Config.svelte index acd6884d..05534461 100644 --- a/src/controls/Config.svelte +++ b/src/controls/Config.svelte @@ -53,6 +53,11 @@ colors: colors.map((c: string) => Color.colorFromString(c, colorSpace) ), + colorSemantics: colors.map(() => ({ + size: undefined, + markType: undefined, + tags: [], + })), evalConfig: {}, name, type, diff --git a/src/controls/GetColorsFromString.svelte b/src/controls/GetColorsFromString.svelte index 016fa766..135cda3b 100644 --- a/src/controls/GetColorsFromString.svelte +++ b/src/controls/GetColorsFromString.svelte @@ -1,10 +1,12 @@