Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnuttandrew committed Jan 12, 2024
1 parent 197b4fa commit d0013f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/components/ColorScatterPlot.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -403,15 +403,15 @@
fill={color.toHex()}
/>
{/if}
{#if !color.inGamut()}
<!-- {#if !color.inGamut()}
<g
pointer-events="none"
transform={`translate(${x(color)} ${y(color)})`}
>
<line stroke="black" x1={-7} y1={-7} x2={7} y2={7}></line>
<line stroke="black" x1={-7} y1={7} x2={7} y2={-7}></line>
</g>
{/if}
{/if} -->
{/each}
{#each blindColors as blindColor, i}
<!-- svelte-ignore a11y-click-events-have-key-events -->
Expand Down
12 changes: 0 additions & 12 deletions src/lib/Color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,6 @@ export class Color {
return this.fromChannels(channels);
}
return this.fromChannels(stringToChannels(this.spaceName, colorString));
// // extract the numbers from the string
// // const regex = new RegExp(`${this.spaceName}\\((.*)% (.*) (.*)\\)`);
// const regex = new RegExp(
// `${this.spaceName}\\((.*?)(%|,)(.*?) (.*?)(%|,) (.*?)\\)\\)`
// );
// const match = colorString.match(regex);
// if (!match) {
// throw new Error(`Invalid color string: ${colorString}`);
// }
// const [_, ...channels] = match;
// console.log(channels);
// return this.fromChannels([+channels[0], +channels[1], +channels[2]]);
}
fromChannels(channels: [number, number, number]): Color {
const newColor = new (this.constructor as typeof Color)();
Expand Down

0 comments on commit d0013f7

Please sign in to comment.