Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various minor fixes #163

Merged
merged 3 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/color-buddy/src/content-modules/TourProvider.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
{
element: "#left-panel",
popover: {
title: "Colors Panel",
title: "Palette Pane",
onCloseClick: closeClick,
description:
"Here are the colors in your palette! You can click on a color to select it and edit it. Each color also shows any issues we've found with it. You can learn more by clicking on the issue icon",
Expand Down
25 changes: 12 additions & 13 deletions apps/color-buddy/src/controls/Config.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@
<div slot="content" class="w-96" let:onClick>
<div class="font-bold">About</div>
<div class="text-sm my-2">
Color buddy is a tool for building color palettes. It was originally
Color buddy is a tool for building color palettes.
<!-- It was originally
written at the

<a
Expand All @@ -112,7 +113,7 @@
target="_blank"
>
Scientific Computing and Imaging Institute.
</a>
</a> -->
You can learn more about it at the{" "}
<a
class="underline text-cyan-800"
Expand All @@ -121,19 +122,17 @@
>
docs.
</a>
You can also find the source code on{" "}
<a
class="underline text-cyan-800"
href=" https://github.com/mcnuttandrew/color-buddy"
target="_blank"
>
GitHub.
</a>
If you have any feedback or questions, please feel free to reach out via the
github issues page or via email. A small amount of non-identifiable usage data
is collected to help improve the application.

Feedback (via github issues or email) is welcome.
</div>
<div class="font-bold">What is saved and where?</div>
<div class="text-sm my-2">
Palettes are saved in your browser's local storage. They are not shared!
They are not available on other browsers or devices. A small amount of
non-identifiable usage data is collected to help improve the application.
</div>

<div class="font-bold">Tools</div>
<div class="flex">
<button
class={buttonStyle}
Expand Down
7 changes: 6 additions & 1 deletion apps/color-buddy/src/controls/InterpolatePoints.svelte
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
<script lang="ts">
import { onMount } from "svelte";
import { Color } from "color-buddy-palette";
import type { Palette } from "color-buddy-palette";
import colorStore from "../stores/color-store";
import focusStore from "../stores/focus-store";
import { buttonStyle } from "../lib/styles";
import Tooltip from "../components/Tooltip.svelte";
import PalPreview from "../components/PalPreview.svelte";

$: currentPal = $colorStore.palettes[$colorStore.currentPal];
$: focusedColors = $focusStore.focusedColors;
$: focusSet = new Set(focusedColors);
$: colors = currentPal.colors;
let colorSpace = "lab";
onMount(() => {
if (currentPal) {
colorSpace = currentPal.colorSpace;
}
});
let numPoints = 1;
$: tempPal = (numPoints &&
colorSpace &&
Expand Down
2 changes: 2 additions & 0 deletions apps/color-buddy/src/scatterplot/ColorScatterPlot.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@
{#if scatterPlotMode === "moving"}
<rect
{...RectProps(color, i)}
stroke={computeStroke(color, i, focusSet, bg)}
on:mousedown|preventDefault={pointMouseDown}
on:mouseup|preventDefault={pointMouseUp(i)}
on:mouseleave|preventDefault={switchToDragPoint(i)}
Expand All @@ -553,6 +554,7 @@
{:else}
<rect
{...RectProps(color, i)}
stroke={computeStroke(color, i, focusSet, bg)}
on:mouseenter|preventDefault={() => hoverPoint(i)}
/>
{/if}
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/docs/lang-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This page contains examples of the language used to define palettes and the expe
**Tasks**: sequential, diverging, categorical


**Description**: Colors used need to have sufficient contrast with the background to make them legible, as defined by WCAG21 contrast ratios. For this check (for graphical objects) there should be at least a 3:1 contrast ratio. If this lint is not failing and you believe it should be, ensure that a color has been selected as having the "text" tag.
**Description**: Colors used need to have sufficient contrast with the background to make them legible, as defined by WCAG21 contrast ratios. For this check (for graphical objects) there should be at least a 3:1 contrast ratio.

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ This page contains examples of the language used to define palettes and the expe
**Tasks**: sequential, diverging, categorical


**Description**: Colors used need to have sufficient contrast with the background to make them legible, as defined by WCAG21 contrast ratios. For this check (for graphical objects) there should be at least a 3:1 contrast ratio. If this lint is not failing and you believe it should be, ensure that a color has been selected as having the "text" tag.
**Description**: Colors used need to have sufficient contrast with the background to make them legible, as defined by WCAG21 contrast ratios. For this check (for graphical objects) there should be at least a 3:1 contrast ratio.

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

Expand Down
3 changes: 1 addition & 2 deletions packages/palette-lint/src/lints/background-contrast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ const contrastGraphicalObjects: LintProgram = {
...lintBase,
description:
descriptionBase +
" For this check (for graphical objects) there should be at least a 3:1 contrast ratio." +
textPart,
" For this check (for graphical objects) there should be at least a 3:1 contrast ratio.",
program: JSONToPrettyString(buildProgram(3, false)),
name: " Graphical objects contrast",
id: "contrast-graphical-objects-built-in",
Expand Down
Loading