Skip to content

fix(core): uncap saturate chroma and resolve planeHue as an OKLCH hue - #238

Merged
pbroom merged 2 commits into
mainfrom
fix/core-saturate-and-plane-hue
Oct 10, 2026
Merged

pbroom merged 2 commits into
mainfrom
fix/core-saturate-and-plane-hue

Conversation

@pbroom

@pbroom pbroom commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

saturate/desaturate clamped chroma to [0, 0.4], so wide-gamut colors
above 0.4 lost chroma (saturate lowered it, desaturate(c, 0) changed
it). Chroma is now only clamped below at 0, like lighten/darken clamp
lightness to its domain; 0.4 stays as the saturate step span.

planeHue returned the model's own hue on HSL, HSV and HCT planes, but
its callers (gamut boundary, contrast and chroma-band queries and their
result hue) expect an OKLCH hue. It now converts the fixed color, and
falls back to the model hue's most saturated color when that fixed color
is achromatic.

Found while documenting the public API in #235. Each finding was reproduced against the built package before the fix, has a regression test, and its affected JSDoc examples were recomputed. lint, build, test, format:check, typecheck, size, check:artifacts, check:preprod and agents:check:strict pass.

Part of the color-kit assessment stack.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
color-kit Ready Ready Preview Oct 10, 2026 8:13pm UTC

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T03:29:51.040535Z 51241a5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This was referenced Oct 8, 2026
@greptile-apps

greptile-apps Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adjusts color saturation and hue resolution logic.

This PR appears safe to merge; no actionable issue was found.

What we checked:

  • Unknown models cannot select functions: planeHue checks the model before reading SATURATED_HUE_SAMPLES. Only supported model names pass, and the samples are fixed functions.

Summary

Removes the upper chroma cap from saturate and desaturate, while keeping the lower bound at zero.

  • planeHue now converts HSL, HSV, and HCT colors to an OKLCH hue.
  • Achromatic colors use a saturated sample of their model hue.
  • Adds regression tests, updates query documentation, and includes a patch changeset.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["planeHue"] --> B{"Finite explicit hue?"}
  B -- Yes --> C["Normalize and return"]
  B -- No --> D{"OKLCH plane with fixed hue?"}
  D -- Yes --> C
  D -- No --> E["Convert fixed color to OKLCH"]
  E --> F{"Achromatic HSL, HSV, or HCT color?"}
  F -- Yes --> G["Convert saturated hue sample"]
  F -- No --> H["Return converted hue"]
  G --> H
Loading

Reviews (1) · Last reviewed commit: "fix(core): uncap saturate chroma and res..." · Reviewed by Greptile

@pbroom pbroom left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full incremental PR and its corrections at d8af837fc1ac1a1cee4d32e4d1551288abbafcd1. Saturate and plane hue reviewed; inherited gradient tests preserved. No remaining actionable findings in the reviewed scope.

Independent correction re-reviews and stack preservation verification passed. At the integrated tip, lint, full build/DTS, 2,208 tests, formatting, strict agent checks and 14 built-site Chrome tests passed. All recorded actionable review threads are addressed. Hosted CI is being verified separately; this review does not authorize merge or release.

pbroom commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner Author

Merge activity

  • Oct 10, 6:47 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 10, 8:10 PM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 10, 8:11 PM UTC: @pbroom merged this pull request with Graphite.

@pbroom
pbroom changed the base branch from fix/api-doc-findings-validation to graphite-base/238 October 10, 2026 20:07
@pbroom
pbroom changed the base branch from graphite-base/238 to main October 10, 2026 20:08
pbroom and others added 2 commits October 10, 2026 20:09
saturate/desaturate clamped chroma to [0, 0.4], so wide-gamut colors
above 0.4 lost chroma (saturate lowered it, desaturate(c, 0) changed
it). Chroma is now only clamped below at 0, like lighten/darken clamp
lightness to its domain; 0.4 stays as the saturate step span.

planeHue returned the model's own hue on HSL, HSV and HCT planes, but
its callers (gamut boundary, contrast and chroma-band queries and their
result hue) expect an OKLCH hue. It now converts the fixed color, and
falls back to the model hue's most saturated color when that fixed color
is achromatic.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@pbroom
pbroom force-pushed the fix/core-saturate-and-plane-hue branch from c79d502 to 97850a5 Compare October 10, 2026 20:09
@pbroom
pbroom merged commit f8fcdb6 into main Oct 10, 2026
6 of 7 checks passed
@pbroom
pbroom deleted the fix/core-saturate-and-plane-hue branch October 10, 2026 20:11

This branch was successfully deployed

1 active deployment
Preview — 97850a5a Deployed Oct 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant