LeanPlot: Interactive Plotting for Lean 4

5. Color Palette🔗

LeanPlot automatically assigns colors from a carefully chosen palette.

🔗def
LeanPlot.Palette.colorFromNat (n : Nat) : LeanPlot.Palette.Color✝
LeanPlot.Palette.colorFromNat (n : Nat) : LeanPlot.Palette.Color✝

A function that maps a natural number to a color from the default palette. The colors repeat if n is larger than the number of colors in the palette.

🔗def
LeanPlot.Palette.autoColors (names : Array String) : Array (String × String)
LeanPlot.Palette.autoColors (names : Array String) : Array (String × String)

Given an Array of series names, assign each a color from defaultPalette, cycling if necessary. The result is suitable for the seriesStrokes argument expected by LeanPlot.Components.mkLineChart and friends.