Skip to content

Commit

Permalink
small language corrections (#62)
Browse files Browse the repository at this point in the history
* small corrections

* test fix
  • Loading branch information
mcnuttandrew authored Mar 27, 2024
1 parent b2801ed commit 6782e90
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 46 deletions.
16 changes: 8 additions & 8 deletions public/lang-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Maps:

### WCAG Contrast Graphical Objects

Description: All colors in a palette should have a sufficient contrast ratio with the background color. This is because if they are not, then they will not be differentiable from each other in some contexts. Valid algorithms are "APCA", "WCAG21", "Michelson", "Weber", "Lstar", "DeltaPhi".
Description: All colors in a palette should have a sufficient contrast ratio with the background color. This is because if they are not, then they will not be differentiable from each other in some contexts. Valid algorithms are "APCA", "WCAG21", "Michelson", "Weber", "Lstar", "DeltaPhi". If this lint is not failing and you believe it should be, ensure that a color has been selected as having the "text" tag.

Natural Language: ALL a IN colors SUCH THAT contrast(a, background, WCAG21) > 3

Expand Down Expand Up @@ -132,9 +132,9 @@ Program:



### WCAG Text Contrast: AA
### WCAG Text Contrast: AA (text colors only)

Description: All colors in a palette should have a sufficient contrast ratio with the background color. This is because if they are not, then they will not be differentiable from each other in some contexts. Valid algorithms are "APCA", "WCAG21", "Michelson", "Weber", "Lstar", "DeltaPhi".
Description: All colors in a palette should have a sufficient contrast ratio with the background color. This is because if they are not, then they will not be differentiable from each other in some contexts. Valid algorithms are "APCA", "WCAG21", "Michelson", "Weber", "Lstar", "DeltaPhi". If this lint is not failing and you believe it should be, ensure that a color has been selected as having the "text" tag.

Natural Language: ALL a IN colors WHERE isTag(a, text) SUCH THAT contrast(a, background, WCAG21) > 4.5

Expand Down Expand Up @@ -173,9 +173,9 @@ Program:



### WCAG Text Contrast: AAA
### WCAG Text Contrast: AAA (text colors only)

Description: All colors in a palette should have a sufficient contrast ratio with the background color. This is because if they are not, then they will not be differentiable from each other in some contexts. Valid algorithms are "APCA", "WCAG21", "Michelson", "Weber", "Lstar", "DeltaPhi".
Description: All colors in a palette should have a sufficient contrast ratio with the background color. This is because if they are not, then they will not be differentiable from each other in some contexts. Valid algorithms are "APCA", "WCAG21", "Michelson", "Weber", "Lstar", "DeltaPhi". If this lint is not failing and you believe it should be, ensure that a color has been selected as having the "text" tag.

Natural Language: ALL a IN colors WHERE isTag(a, text) SUCH THAT contrast(a, background, WCAG21) > 7

Expand Down Expand Up @@ -409,7 +409,7 @@ Program:

### CVD: Deuteranopia Friendly

Description: All colors in a palette should be differentiable by people with deuteranopia (ie can't see green). This is because if they are not, then they will not be differentiable from each other in some contexts.
Description: All colors in a palette should be differentiable by people with deuteranopia (effects 0.56% of population). This is because if they are not, then they will not be differentiable from each other in some contexts.

Natural Language: ALL a, b IN colors WHERE index(a) != index(b) SUCH THAT NOT similar(cvdSim(a, deuteranopia), cvdSim(b, deuteranopia)) < 9

Expand Down Expand Up @@ -453,7 +453,7 @@ Program:

### CVD: Protanopia Friendly

Description: All colors in a palette should be differentiable by people with protanopia (ie can't see red). This is because if they are not, then they will not be differentiable from each other in some contexts.
Description: All colors in a palette should be differentiable by people with protanopia (effects 0.59% of population). This is because if they are not, then they will not be differentiable from each other in some contexts.

Natural Language: ALL a, b IN colors WHERE index(a) != index(b) SUCH THAT NOT similar(cvdSim(a, protanopia), cvdSim(b, protanopia)) < 9

Expand Down Expand Up @@ -497,7 +497,7 @@ Program:

### CVD: Tritanopia Friendly

Description: All colors in a palette should be differentiable by people with tritanopia (ie can't see blue). This is because if they are not, then they will not be differentiable from each other in some contexts.
Description: All colors in a palette should be differentiable by people with tritanopia . This is because if they are not, then they will not be differentiable from each other in some contexts.

Natural Language: ALL a, b IN colors WHERE index(a) != index(b) SUCH THAT NOT similar(cvdSim(a, tritanopia), cvdSim(b, tritanopia)) < 9

Expand Down
4 changes: 2 additions & 2 deletions src/content-modules/TourProvider.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
{
element: "#scatterplot",
popover: {
title: "Scatterplot",
title: "Edit plane",
onCloseClick: closeClick,
description:
"The scatterplot shows the colors in your palette in a 2D space. You can drag the colors around to adjust their position. You can also drag a box around a group of colors and move it around, just like you would in a graphics editor.",
"The edit plane shows the colors in your palette in a 2D space as a scatterplot and a strip plot. You can drag the colors around to adjust their position. You can also drag a box around a group of colors and move it around, just like you would in a graphics editor.",
onNextClick: () => {
configStore.setColorSim("deuteranopia");
driverObj.moveNext();
Expand Down
4 changes: 2 additions & 2 deletions src/lib/ColorLint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ test("ColorLint - Background Contrast", async () => {
const exampleLint = new BackgroundContrastLint(examplePal).run();
expect(exampleLint.passes).toBe(false);
expect(exampleLint.message).toBe(
"These colors (#0ff, #00faff, #00e4ff, #fdfdfc, #0ff) do not have a sufficient contrast ratio with the background and may be hard to discriminate in some contexts."
"These colors (#0ff, #00faff, #00e4ff, #fdfdfc, #0ff) do not have a sufficient contrast do not have sufficient contrast with the background to be easily readable."
);
const fix = await suggestLintFix(examplePal, exampleLint).then((x) => x[0]);
expect(fix.colors.map((x) => x.color.toHex())).toMatchSnapshot();
Expand All @@ -119,7 +119,7 @@ test("ColorLint - Background Contrast", async () => {
const exampleLint2 = new BackgroundContrastLint(examplePal).run();
expect(exampleLint2.passes).toBe(false);
expect(exampleLint2.message).toBe(
"These colors (#0ff, #00faff, #00e4ff, #fdfdfc, #0ff) do not have a sufficient contrast ratio with the background and may be hard to discriminate in some contexts."
"These colors (#0ff, #00faff, #00e4ff, #fdfdfc, #0ff) do not have a sufficient contrast do not have sufficient contrast with the background to be easily readable."
);
const fix2 = await suggestLintFix(examplePal, exampleLint2).then((x) => x[0]);
expect(fix2.colors.map((x) => x.color.toHex())).toMatchSnapshot();
Expand Down
24 changes: 12 additions & 12 deletions src/lib/__snapshots__/ColorLint.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ exports[`ColorLint - Background Contrast 2`] = `
]
`;

exports[`ColorLint - CVD: Deuteranopia 1`] = `"This palette is not friendly for people with deuteranopia color vision deficiency (ie can't see green). The following pairs are undifferentiable: ()"`;
exports[`ColorLint - CVD: Deuteranopia 1`] = `"This palette is not friendly for people with deuteranopia color vision deficiency. The following pairs are undifferentiable: ()"`;

exports[`ColorLint - CVD: Deuteranopia 2`] = `"This palette is not friendly for people with deuteranopia color vision deficiency (ie can't see green). The following pairs are undifferentiable: (#0078b4 and #8c69bc, #ff7e0e and #c4bc27, #3d9f2f and #da2827, #e179c1 and #00becf)"`;
exports[`ColorLint - CVD: Deuteranopia 2`] = `"This palette is not friendly for people with deuteranopia color vision deficiency. The following pairs are undifferentiable: (#0078b4 and #8c69bc, #ff7e0e and #c4bc27, #3d9f2f and #da2827, #e179c1 and #00becf)"`;

exports[`ColorLint - CVD: Grayscale 1`] = `"This palette may not work in black and white. The following pairs are hard to tell the difference between: ()"`;

exports[`ColorLint - CVD: Grayscale 2`] = `"This palette may not work in black and white. The following pairs are hard to tell the difference between: (#0078b4 and #da2827, #0078b4 and #8c69bc, #0078b4 and #8e564b, #0078b4 and #7f7f7f, #ff7e0e and #3d9f2f, #ff7e0e and #e179c1, #ff7e0e and #c4bc27, #ff7e0e and #00becf, #3d9f2f and #8c69bc, #3d9f2f and #e179c1, #3d9f2f and #7f7f7f, #da2827 and #8c69bc, #da2827 and #8e564b, #da2827 and #7f7f7f, #8c69bc and #8e564b, #8c69bc and #7f7f7f, #e179c1 and #c4bc27, #e179c1 and #00becf, #c4bc27 and #00becf)"`;

exports[`ColorLint - CVD: Protanopia 1`] = `"This palette is not friendly for people with protanopia color vision deficiency (ie can't see red). The following pairs are undifferentiable: ()"`;
exports[`ColorLint - CVD: Protanopia 1`] = `"This palette is not friendly for people with protanopia color vision deficiency. The following pairs are undifferentiable: ()"`;

exports[`ColorLint - CVD: Protanopia 2`] = `"This palette is not friendly for people with protanopia color vision deficiency (ie can't see red). The following pairs are undifferentiable: (#0078b4 and #8c69bc, #ff7e0e and #3d9f2f, #da2827 and #8e564b)"`;
exports[`ColorLint - CVD: Protanopia 2`] = `"This palette is not friendly for people with protanopia color vision deficiency. The following pairs are undifferentiable: (#0078b4 and #8c69bc, #ff7e0e and #3d9f2f, #da2827 and #8e564b)"`;

exports[`ColorLint - CVD: Tritanopia 1`] = `"This palette is not friendly for people with tritanopia color vision deficiency (ie can't see blue). The following pairs are undifferentiable: ()"`;
exports[`ColorLint - CVD: Tritanopia 1`] = `"This palette is not friendly for people with tritanopia color vision deficiency. The following pairs are undifferentiable: ()"`;

exports[`ColorLint - CVD: Tritanopia 2`] = `"This palette is not friendly for people with tritanopia color vision deficiency (ie can't see blue). The following pairs are undifferentiable: (#ff7e0e and #e179c1, #8c69bc and #7f7f7f)"`;
exports[`ColorLint - CVD: Tritanopia 2`] = `"This palette is not friendly for people with tritanopia color vision deficiency. The following pairs are undifferentiable: (#ff7e0e and #e179c1, #8c69bc and #7f7f7f)"`;

exports[`ColorLint - CatOrderSimilarity 1`] = `"Some sequences of colors are too similar based on dE scores: . Try reordering them or making them more distinguishable"`;

Expand All @@ -48,17 +48,17 @@ exports[`ColorLint - ColorNameDiscriminability 1`] = `"The following pairs of co

exports[`ColorLint - ColorNameDiscriminability 2`] = `"The following pairs of colors have the same name: #5260d1 and #005ebe"`;

exports[`ColorLint - Contrast (1) GraphicalObjs 1`] = `"These colors () do not have a sufficient contrast ratio with the background and may be hard to discriminate in some contexts."`;
exports[`ColorLint - Contrast (1) GraphicalObjs 1`] = `"These colors () do not have a sufficient contrast do not have sufficient contrast with the background to be easily readable."`;

exports[`ColorLint - Contrast (1) GraphicalObjs 2`] = `"These colors (#feed72, #f8f4d2, #eb717b) do not have a sufficient contrast ratio with the background and may be hard to discriminate in some contexts."`;
exports[`ColorLint - Contrast (1) GraphicalObjs 2`] = `"These colors (#feed72, #f8f4d2, #eb717b) do not have a sufficient contrast do not have sufficient contrast with the background to be easily readable."`;

exports[`ColorLint - Contrast (2) contrastTextAA 1`] = `"These colors () do not have a sufficient contrast ratio with the background and may be hard to discriminate in some contexts."`;
exports[`ColorLint - Contrast (2) contrastTextAA 1`] = `"These text colors ({{blame}) do not have a sufficient contrast do not have sufficient contrast with the background to be easily readable."`;
exports[`ColorLint - Contrast (2) contrastTextAA 2`] = `"These colors (#eb717b) do not have a sufficient contrast ratio with the background and may be hard to discriminate in some contexts."`;
exports[`ColorLint - Contrast (2) contrastTextAA 2`] = `"These text colors ({{blame}) do not have a sufficient contrast do not have sufficient contrast with the background to be easily readable."`;
exports[`ColorLint - Contrast (3) contrastTextAAA 1`] = `"These colors () do not have a sufficient contrast ratio with the background and may be hard to discriminate in some contexts."`;
exports[`ColorLint - Contrast (3) contrastTextAAA 1`] = `"These text colors ({{blame}) do not have a sufficient contrast do not have sufficient contrast with the background to be easily readable."`;
exports[`ColorLint - Contrast (3) contrastTextAAA 2`] = `"These colors (#af3b4b) do not have a sufficient contrast ratio with the background and may be hard to discriminate in some contexts."`;
exports[`ColorLint - Contrast (3) contrastTextAAA 2`] = `"These text colors ({{blame}) do not have a sufficient contrast do not have sufficient contrast with the background to be easily readable."`;
exports[`ColorLint - EvenDistribution (1) Hue 1`] = `"This palette does not evenly distribute the colors around its range correctly. Try making the spacing between the colors more regular to resolve this issue. "`;
Expand Down
16 changes: 8 additions & 8 deletions src/lib/__snapshots__/LintDocs.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Maps:
### WCAG Contrast Graphical Objects
Description: All colors in a palette should have a sufficient contrast ratio with the background color. This is because if they are not, then they will not be differentiable from each other in some contexts. Valid algorithms are "APCA", "WCAG21", "Michelson", "Weber", "Lstar", "DeltaPhi".
Description: All colors in a palette should have a sufficient contrast ratio with the background color. This is because if they are not, then they will not be differentiable from each other in some contexts. Valid algorithms are "APCA", "WCAG21", "Michelson", "Weber", "Lstar", "DeltaPhi". If this lint is not failing and you believe it should be, ensure that a color has been selected as having the "text" tag.
Natural Language: ALL a IN colors SUCH THAT contrast(a, background, WCAG21) > 3
Expand Down Expand Up @@ -135,9 +135,9 @@ Program:
### WCAG Text Contrast: AA
### WCAG Text Contrast: AA (text colors only)
Description: All colors in a palette should have a sufficient contrast ratio with the background color. This is because if they are not, then they will not be differentiable from each other in some contexts. Valid algorithms are "APCA", "WCAG21", "Michelson", "Weber", "Lstar", "DeltaPhi".
Description: All colors in a palette should have a sufficient contrast ratio with the background color. This is because if they are not, then they will not be differentiable from each other in some contexts. Valid algorithms are "APCA", "WCAG21", "Michelson", "Weber", "Lstar", "DeltaPhi". If this lint is not failing and you believe it should be, ensure that a color has been selected as having the "text" tag.
Natural Language: ALL a IN colors WHERE isTag(a, text) SUCH THAT contrast(a, background, WCAG21) > 4.5
Expand Down Expand Up @@ -176,9 +176,9 @@ Program:
### WCAG Text Contrast: AAA
### WCAG Text Contrast: AAA (text colors only)
Description: All colors in a palette should have a sufficient contrast ratio with the background color. This is because if they are not, then they will not be differentiable from each other in some contexts. Valid algorithms are "APCA", "WCAG21", "Michelson", "Weber", "Lstar", "DeltaPhi".
Description: All colors in a palette should have a sufficient contrast ratio with the background color. This is because if they are not, then they will not be differentiable from each other in some contexts. Valid algorithms are "APCA", "WCAG21", "Michelson", "Weber", "Lstar", "DeltaPhi". If this lint is not failing and you believe it should be, ensure that a color has been selected as having the "text" tag.
Natural Language: ALL a IN colors WHERE isTag(a, text) SUCH THAT contrast(a, background, WCAG21) > 7
Expand Down Expand Up @@ -412,7 +412,7 @@ Program:
### CVD: Deuteranopia Friendly
Description: All colors in a palette should be differentiable by people with deuteranopia (ie can't see green). This is because if they are not, then they will not be differentiable from each other in some contexts.
Description: All colors in a palette should be differentiable by people with deuteranopia (effects 0.56% of population). This is because if they are not, then they will not be differentiable from each other in some contexts.
Natural Language: ALL a, b IN colors WHERE index(a) != index(b) SUCH THAT NOT similar(cvdSim(a, deuteranopia), cvdSim(b, deuteranopia)) < 9
Expand Down Expand Up @@ -456,7 +456,7 @@ Program:
### CVD: Protanopia Friendly
Description: All colors in a palette should be differentiable by people with protanopia (ie can't see red). This is because if they are not, then they will not be differentiable from each other in some contexts.
Description: All colors in a palette should be differentiable by people with protanopia (effects 0.59% of population). This is because if they are not, then they will not be differentiable from each other in some contexts.
Natural Language: ALL a, b IN colors WHERE index(a) != index(b) SUCH THAT NOT similar(cvdSim(a, protanopia), cvdSim(b, protanopia)) < 9
Expand Down Expand Up @@ -500,7 +500,7 @@ Program:
### CVD: Tritanopia Friendly
Description: All colors in a palette should be differentiable by people with tritanopia (ie can't see blue). This is because if they are not, then they will not be differentiable from each other in some contexts.
Description: All colors in a palette should be differentiable by people with tritanopia . This is because if they are not, then they will not be differentiable from each other in some contexts.
Natural Language: ALL a, b IN colors WHERE index(a) != index(b) SUCH THAT NOT similar(cvdSim(a, tritanopia), cvdSim(b, tritanopia)) < 9
Expand Down
Loading

0 comments on commit 6782e90

Please sign in to comment.