diff --git a/src/lib/components/combinations/CombinationGrid.svelte b/src/lib/components/combinations/CombinationGrid.svelte index 4381105..9bcf827 100644 --- a/src/lib/components/combinations/CombinationGrid.svelte +++ b/src/lib/components/combinations/CombinationGrid.svelte @@ -1,14 +1,11 @@
- {#each $cross as { id, name, rgb } (id)} + {#each $colorEntries as { id, name, rgbColor } (id)} | - + Tt | @@ -54,36 +51,51 @@
---|---|
|
- {#each bgs as { grade }, i ($cross[i].id)}
+ {#each $colorEntries as { id: fgId }, fgIndex (fgId)}
- {#if i !== j} + {#if fgIndex !== bgIndex} { - $selectedCombinations[ - $cross[i].id - ][id] = e.target.checked; + bgId + ]?.[fgId]} + on:change={(e) => { + if ( + bgId in + $selectedCombinations + ) { + $selectedCombinations[ + bgId + ][fgId] = + e.target.checked; + } else { + $selectedCombinations[ + bgId + ] = { + [fgId]: + e.target.checked + }; + } }} /> - | @@ -104,6 +116,34 @@ Add colors to your palette to try color combinations. {/if} + +