Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnuttandrew committed Jan 24, 2024
1 parent 6d969f4 commit f880476
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ First time you start it up you should also run `yarn prep data`
- [ ] XYY is probaably now possible
- [ ] Bug: rotate in polar coordinates doesn't work right
- [ ] Ad hoc lints seem possible, do a spike
- [ ] Directional subtlies for aligns
- [x] Similarly, would like to work through the various options for the examples. Delete, Edit, Hide (not Mute) seem good. If you're going to Hide, then ideally you provide a selective unhide (dropdown of names is the easiest) as well as the unhide all. Your Solo means "hide everything else" which I'm not convinced is worth a button. However, a "full screen" or "fit width" "fit height" options that scales it up and reduces the rest to thumbnails might be cool. And I'm sure there are a few more we'll discover as we work with it.
- [x] Albers color theory games style examples

Expand Down
17 changes: 11 additions & 6 deletions src/content-modules/contextual-tools/DistributePoints.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
import { Color, colorPickerConfig } from "../../lib/Color";
import colorStore from "../../stores/color-store";
import focusStore from "../../stores/focus-store";
import { buttonStyle, buttonStyleDisabled } from "../../lib/styles";
import { buttonStyle } from "../../lib/styles";
$: colors = $colorStore.currentPal.colors;
$: focusedColors = $focusStore.focusedColors;
$: colorSpace = $colorStore.currentPal.colorSpace;
$: config = colorPickerConfig[colorSpace];
$: zName = colorPickerConfig[colorSpace].zChannel;
type Direction = "horizontal" | "vertical" | "in z space";
function distributePoints(direction: Direction) {
Expand All @@ -33,10 +34,10 @@
const zIdx = config.zChannelIndex;
if (direction === "horizontal") {
newPoint[xIdx] = minPoint[xIdx] * (1 - t) + maxPoint[xIdx] * t;
} else if (direction === "in z space") {
newPoint[zIdx] = minPoint[zIdx] * (1 - t) + maxPoint[zIdx] * t;
} else {
} else if (direction === "vertical") {
newPoint[yIdx] = minPoint[yIdx] * (1 - t) + maxPoint[yIdx] * t;
} else {
newPoint[zIdx] = minPoint[zIdx] * (1 - t) + maxPoint[zIdx] * t;
}
return newPoint as Channels;
});
Expand All @@ -51,7 +52,11 @@
colorStore.setCurrentPalColors(newColors);
}
const directions: Direction[] = ["horizontal", "vertical", "in z space"];
$: directions = [
"horizontal",
"vertical",
`in ${zName} space`,
] as Direction[];
</script>

{#if focusedColors.length > 2}
Expand All @@ -60,7 +65,7 @@
<div class="flex flex-wrap">
{#each directions as direction}
<button class={buttonStyle} on:click={() => distributePoints(direction)}>
{direction}ly
{direction}
</button>
{/each}
</div>
Expand Down

0 comments on commit f880476

Please sign in to comment.