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
Contributor

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.

@Boring-Software-Inc Boring-Software-Inc deleted a comment from tripwire-dev Bot Jul 13, 2026
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.
@DloomPlz
DloomPlz force-pushed the feat/custom-seeds branch from 14456b9 to 36fcd21 Compare July 13, 2026 13:21
@DloomPlz

Copy link
Copy Markdown
Contributor Author

Rebased onto the #12 memoization rework — the custom-Seed branch now lives inside the useCallback'd seedOf in both controllers. Registry JSON regenerated; suite green (24/24).

@tripwire-dev

tripwire-dev Bot commented Jul 13, 2026

Copy link
Copy Markdown

passed — nothing tripped. good to merge.

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