Improve gradient quality with contrast enforcement and layout-aware geometry#35
Conversation
…eometry - Add enforceColorSeparation() to ensure minimum hue/luminance delta between gradient stops - Apply layout-specific gradient geometry at render time (radial for Spotlight, linear for Peak) - Inject warm/cool bias for neutral palettes to prevent muddy gradients - Increase accent detection thresholds to avoid picking UI neutrals
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function gradientToCssWithLayout( | ||
| gradient: CustomGradient, | ||
| layoutId: string, | ||
| variant?: string | ||
| ): string { | ||
| const stops = getGradientStopsString(gradient); | ||
| const geometry = getLayoutGeometry(layoutId, variant); | ||
|
|
||
| if (geometry.type === "radial") { | ||
| return `radial-gradient(${geometry.direction}, ${stops})`; | ||
| } | ||
| return `linear-gradient(${geometry.angle}deg, ${stops})`; |
There was a problem hiding this comment.
Respect stored gradient geometry when rendering
Rendering now ignores the geometry stored on the CustomGradient. gradientToCssWithLayout derives the angle/type solely from getLayoutGeometry, so any type, angle, or direction saved on the gradient (set by the gradient picker’s angle control or by applyPreferredAngle) is discarded. This means rotating a gradient or choosing a non-linear type in the UI no longer changes the background—layout defaults always win.
Useful? React with 👍 / 👎.
Improve gradient quality with contrast enforcement and layout-aware geometry
Summary
Test plan