Draw charts from one categorical palette, --chart-1…8
The one-hue ramp told lines apart by lightness alone. --chart-1 is now --primary and slots 2-8 are distinct hues (orange, violet, green, orchid, ochre, teal, magenta) that clear 3:1 on --card and stay apart under protanopia and deuteranopia; red and sage are left out as the status colours. A chart takes the slots in order instead of spreading a ramp, and a dashboard's own palette continues after its primary and listed colours with slots 2-8 rather than tints of its scheme. Line charts stay at five series. Tokens mirror index's, as design-check requires. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013GAeg4Jo6xjZzjwy9QDWMQ
This commit is contained in:
@@ -172,14 +172,13 @@ const PaletteContext = createContext(NO_PALETTE)
|
||||
/**
|
||||
* The data colours everything drawn under it uses.
|
||||
*
|
||||
* The colours a palette named, in draw order — the primary first, then the
|
||||
* accent, then whatever it listed after the roles. Empty when the dashboard
|
||||
* names no palette, which is not the same as "the ramp": a chart with no
|
||||
* palette spreads itself across the ramp by how many lines it draws
|
||||
* (`slotsFor`), and only a named palette overrides that.
|
||||
* The colours a palette named, in draw order — the primary first, then
|
||||
* whatever it listed after the roles, then the shared palette's own hues.
|
||||
* Empty when the dashboard names no palette: a chart then takes the shared
|
||||
* `--chart-1…8` in order (`slotsFor`).
|
||||
*
|
||||
* Mounted by the view *and* the editor: an editor drawing the automatic
|
||||
* spread while the panel beside it showed the dashboard's own palette would
|
||||
* Mounted by the view *and* the editor: an editor drawing the shared
|
||||
* palette while the panel beside it showed the dashboard's own palette would
|
||||
* be a preview that lies.
|
||||
*
|
||||
* Data colour only. A fault stays `--destructive` and a condition stays its
|
||||
@@ -203,7 +202,7 @@ export function PaletteProvider({
|
||||
)
|
||||
}
|
||||
|
||||
/** The ramp slots the dashboard around this widget named, or none. */
|
||||
/** The data colours the dashboard around this widget named, or none. */
|
||||
export const usePalette = () => useContext(PaletteContext)
|
||||
|
||||
const LockedContext = createContext(false)
|
||||
|
||||
Reference in New Issue
Block a user