Skip to content

fix: choose inside label contrast for gradient fills - #1173

Open
maxneovici wants to merge 1 commit into
ecomfe:masterfrom
maxneovici:fix/gradient-inside-label-contrast
Open

maxneovici wants to merge 1 commit into
ecomfe:masterfrom
maxneovici:fix/gradient-inside-label-contrast

Conversation

@maxneovici

Copy link
Copy Markdown

Gradient-filled paths currently use the light inside-label fallback regardless of the fill colors, so labels become difficult to read on pale bars and pie segments.

Use average color-stop luminance, matching the existing gradient-background approach, to apply the same label-color thresholds as solid fills. Patterns and empty gradients retain their fallback. Fill definitions are not mutated.

Validation: all 75 unit tests pass, including seven new linear/radial gradient and fallback cases; the modified source passes ESLint. An application-level SVG chart regression fails before the patch and passes afterward in Chromium and Firefox. npm run checktype reports an existing this typing error in src/canvas/Painter.ts:1254; verified the same failure on unmodified HEAD.

The fix is also carried as an installed-version patch in https://github.com/Neovici/cosmoz-frontend/pull/11238 while awaiting an upstream release.

This branch has not been deployed

No deployments
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