Gamut boundaries, gamut fitting, workers and more#50
Merged
Conversation
✅ Deploy Preview for color-input ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…pdated select unicode char, remove leading zeros on lAB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This branch modernizes the color area picker, moving heavy math off the main thread for smoother interaction. It adds gamut visualization/controls (lines, boundary zoom, stretching), CSS anchor progressive enhancement, ships a small perf pass, refreshes docs/examples, and updates styles.
Highlights
• New web worker for area computations to keep UI responsive.
• Gamut tools: lines, boundary zoom, and stretching for better out‑of‑gamut handling.
• Performance tune-up in core picker flow.
• Docs expanded and reorganized with refreshed demos and styles.
• Perf fix suggestion from @TrySound ❤️
Technical changes
• Added worker: src/area-picker.worker.ts (off‑thread calculations).
• Major refactor/expansion: src/area-picker.ts.
• Targeted updates: src/color-input.ts, src/utils/positioning.ts, src/utils/template.ts.
• New stylesheet entry: src/styles/index.css.
Docs and styles
• Docs pages updated: advanced.mdx, api.mdx, index.mdx, styling.mdx.
• Demo/components updates: ColorInputDemo.astro, EventLogger.astro, Head.astro.
• Style tweaks: docs/src/styles/{custom.css,demos.css}.
Stats
• 16 files changed, 1683 insertions, 468 deletions.
• Largest changes: src/area-picker.ts (+787 −60), src/area-picker.worker.ts (+489 −0), docs/src/styles/demos.css (+101 −59), src/styles/index.css (+61 −0), src/color-input.ts (+57 −15).
Breaking changes
• None detected (no “BREAKING CHANGE” or “!” commits found).
How to test
• Verify smooth interaction under rapid pointer movement (worker offloads).
• Exercise gamut tools: lines render correctly; boundary zoom focuses edges; stretching behaves predictably for out‑of‑gamut colors.
• Sanity-check color-input integration and positioning utilities.
• Review updated docs pages build and render correctly with refreshed demos.
Checklist
Cross-browser smoke test (Chromium, WebKit, Firefox).
Confirm no regressions in keyboard/mouse/touch interactions.
Verify docs navigation and anchors still function.