UNPKG

recharts

Version:
41 lines (40 loc) • 1.69 kB
import { RechartsTheme } from './RechartsTheme'; /** * Categorical series colors for a #fff background. * * Order matters. Graphical items take colors from the front of this list (by * sorted dataKey), so a chart with N series always gets the first N entries. * The order is tuned so that every prefix stays distinguishable in typical * vision and under protanopia, deuteranopia and tritanopia, with the widest * separation in the first 4-8 entries where most charts live. * * Entries 1-8 share one band of lightness and chroma, so no series looks * heavier or more important than another. Entries 9-12 step outside that band * where they can, because twelve hues at one lightness cannot all stay apart * under color vision deficiency: Purple is darker and Teal is less saturated. * At 4.5:1 the band already sits close to the lightest a color can be, so they * cannot step outside it upward. * * Every entry has at least 4.5:1 contrast against the background as a stroke, * the WCAG contrast for text, so a label in the series color stays readable. * Painted as an opaque fill (`fillOpacity` 1), every entry keeps the same contrast * (WCAG 1.4.11). * * Entry N is the same hue family in the light and dark palettes, so a series * keeps its identity when the theme changes. Comments show stroke contrast. * * @see {@link https://recharts.github.io/en-US/guide/theming/ Theming guide} * * @since 3.11 * @public */ export declare const lightPalette: ReadonlyArray<string>; /** * Light mode theme * * @see {@link https://recharts.github.io/en-US/guide/theming/ Theming guide} * * @since 3.11 * @public */ export declare const lightTheme: RechartsTheme;