diff --git a/src/App.svelte b/src/App.svelte index 270cea4f..29b17825 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -39,7 +39,7 @@ $: updateSearchDebounced = debounce(10, (pal: any) => { // keep the noise down on the console if (!selectedLint && pal) { - lint(pal).then((res) => { + lint(pal, true).then((res) => { lintStore.postCurrentChecks(res); }); } diff --git a/src/content-modules/ComparePal.svelte b/src/content-modules/ComparePal.svelte index a035feab..c9cf7303 100644 --- a/src/content-modules/ComparePal.svelte +++ b/src/content-modules/ComparePal.svelte @@ -33,7 +33,7 @@ let colorSpace = ComparisonPal?.colorSpace || "lab"; -
+
{#if ComparisonPal !== undefined}
@@ -112,7 +112,10 @@
@@ -124,13 +127,20 @@ /> -->
{/if} -
-
+
{#if exampleIdx === -1} + allowInteraction && focusStore.setColors( dealWithFocusEvent(e, i, $focusStore.focusedColors) )} @@ -102,13 +104,14 @@ }`} style={`${styleMap(colors[colorIdx])}`} on:click|preventDefault|stopPropagation={(e) => { - focusStore.setColors( - dealWithFocusEvent( - e, - colorIdx, - $focusStore.focusedColors - ) - ); + allowInteraction && + focusStore.setColors( + dealWithFocusEvent( + e, + colorIdx, + $focusStore.focusedColors + ) + ); }} > {/each} @@ -125,9 +128,10 @@ }deg)`} class="mr-2 w-16" on:click|preventDefault|stopPropagation={(e) => { - focusStore.setColors( - dealWithFocusEvent(e, i, $focusStore.focusedColors) - ); + allowInteraction && + focusStore.setColors( + dealWithFocusEvent(e, i, $focusStore.focusedColors) + ); }} > {color.toHex()} diff --git a/src/lib/lints/max-colors.ts b/src/lib/lints/max-colors.ts index efc7a664..1fec7e17 100644 --- a/src/lib/lints/max-colors.ts +++ b/src/lib/lints/max-colors.ts @@ -7,7 +7,7 @@ const lint: CustomLint = { program: JSONToPrettyString({ // @ts-ignore $schema: `${location.href}lint-schema.json`, - "<": { left: { count: "colors" }, right: 10 }, + "<": { left: { count: "colors" }, right: 11 }, }), taskTypes: ["sequential", "diverging", "categorical"] as const, level: "warning", diff --git a/src/scatterplot/ColorScatterPlot.svelte b/src/scatterplot/ColorScatterPlot.svelte index f2a9bee7..78ff7456 100644 --- a/src/scatterplot/ColorScatterPlot.svelte +++ b/src/scatterplot/ColorScatterPlot.svelte @@ -34,7 +34,7 @@ $: focusSet = new Set(focusedColors); - let margin = { top: 15, right: 15, bottom: 15, left: 15 }; + let margin = { top: 20, right: 15, bottom: 15, left: 15 }; $: plotWidth = width - margin.left - margin.right; $: plotHeight = height - margin.top - margin.bottom; $: extents = { @@ -468,6 +468,17 @@ on:touchend|preventDefault={puttingEnd} /> {/if} + + + {#if typeof hoveredPoint !== "boolean"} + + + {hoveredPoint.toHex()} + + {hoveredPoint.toPrettyString()} + + + {/if}
@@ -577,24 +588,9 @@
-
- {#if typeof hoveredPoint !== "boolean"} - Hovered point: - {hoveredPoint.toPrettyString()} - - {hoveredPoint.toHex()} -
- {:else} -   - {/if} +
+ {#if $configStore.showGamutMarkers}✖ indicates value that is out of gamut{:else} {/if}
-{#if $configStore.showGamutMarkers} -
- X indicates value that is out of gamut -
-{/if}