feat: accept a custom Seed in ChartConfig color#10
Open
DloomPlz wants to merge 1 commit into
Open
Conversation
The palette ships seven named colors; a brand adopting the kit has no way
to plot in its own hue without editing palette.ts by hand. Let config
entries pass a full Seed instead:
const config = {
revenue: { label: "Revenue", color: { fill: [61, 216, 201], line: [160, 240, 231], star: [208, 250, 245] } },
costs: { label: "Costs", color: "grey" }, // named colors unchanged
}
Both controllers resolve through the existing isDitherColor guard, so
every consumer of seedOf (canvas painters, legend, tooltip, dots) picks
custom seeds up with no further changes. Type-level default stays the
named union. Registry JSON regenerated via npm run build.
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.

Motivation
The palette ships seven named colors. A brand adopting the kit (say, with a teal/cyan identity) currently has to hand-edit
palette.tsto plot in its own hue — which means forking a core file and losing clean upstream syncs.What
ChartConfigentries accept a fullSeedalongside the named union:Both controllers resolve through the existing
isDitherColorguard inseedOf, so every consumer (canvas painters, legend, tooltip, dots, radar frame) picks custom seeds up with no further changes. No behavior change for named colors. Registry JSON regenerated vianpm run build.