Skip to content

feat: accept a custom Seed in ChartConfig color#10

Open
DloomPlz wants to merge 1 commit into
Boring-Software-Inc:mainfrom
DloomPlz:feat/custom-seeds
Open

feat: accept a custom Seed in ChartConfig color#10
DloomPlz wants to merge 1 commit into
Boring-Software-Inc:mainfrom
DloomPlz:feat/custom-seeds

Conversation

@DloomPlz

Copy link
Copy Markdown

Motivation

The palette ships seven named colors. A brand adopting the kit (say, with a teal/cyan identity) currently has to hand-edit palette.ts to plot in its own hue — which means forking a core file and losing clean upstream syncs.

What

ChartConfig entries accept a full Seed alongside the named union:

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 in seedOf, 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 via npm run build.

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.
@tripwire-dev

tripwire-dev Bot commented Jul 13, 2026

Copy link
Copy Markdown

tripwire: passed — cleared all 5 rules — good to merge.

for maintainers

every rule, its evidence, and the AI review are on the run page:

View on Tripwire

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