Repository navigation
feat(capytone): image mode and /color-picker-from-image (D50) - #104
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
CapyTone gets a sixth mode, Image: drop, paste or pick a photo → a ranked palette (click a swatch to copy its hex, or copy all as CSS variables / Tailwind tokens), and click — or arrow-key — any pixel for its hex, rgb() and hsl(). Plus the intent page /color-picker-from-image ("color picker from image": 100K–1M/month on Google). D50, L39, L40.
How
decodeImage(CapyResize's), canvases, no route, no upload, no storage. The palette is sampled from a 400 px copy; a pick reads the original pixel (1×1 source rect from the decoded image).rank.ts: clustering split out asrankCounts(counts, deltaE); image mode merges at ΔE00 10. Clusters are now re-sorted by merged count before the 12-cap (L40) — Extract's order can change in that case.export.ts:cssVariables/tailwindColorsgeneralised; the mood exporters call them (output unchanged).tests/capytone-image-boundaries.test.tswalks the transitive import graph and fails on any Extract server module,node:/next/server, request API or web storage.Verified
next typegen && tsc --noEmitclean./color-picker-from-imageopens on Image mode; a dropped 200×100 PNG (150 px #c07952, 50 px #5f7a72) gave swatches 75% / 25%, a click at 90% width picked #5f7a72, and no non-blob request was made. The authoring session also verified three picks on a 6048×4024 photo against an independentcreateImageBitmapread (D50).🤖 Generated with Claude Code