ChartTheme
Documentation for eth_defi.vault_report.theme.ChartTheme Python class.
- class ChartTheme
Bases:
objectColours for report charts, panel frames and hero images.
Colours are CSS strings,
#rrggbbunless noted, because Plotly takes them as is. Pillow code converts them, seeeth_defi.vault_report.charts.to_rgba()and the branding helpers, so members that Pillow draws with must stay#rrggbb.Attributes summary
Theme name,
darkorlight.Page colour behind a panel: the background of the hero images, on which the ranking card sits
Chart panel colour.
Titles and prominent labels
Axis labels and secondary text
Axis lines, zero lines and the panel footer rule
Grid lines; a translucent
rgba()on the dark theme, so it is used by Plotly onlyCategorical series colours in fixed assignment order.
Positive values and the brand accent: gains, above-T-bill averages and the hero returns
Negative values: losses and outflows
US Treasury bill reference lines; amber, so the risk-free rate stands apart from the series colours
Low-emphasis neutral for the summed "Other" group of the TVL and risk and return charts
Top-left panel glow colour, RGBA 0-255.
Methods summary
__init__(name, page_background, surface, ...)- name: str
Theme name,
darkorlight. Also selects the logo variants: the brand logo PNG,logo-horizontal-ai-{name}.png, and the protocol logo for this background, seeeth_defi.vault_report.logos.load_protocol_logo_path()
- page_background: str
Page colour behind a panel: the background of the hero images, on which the ranking card sits
- surface: str
Chart panel colour. Plotly figures are styled with it but rendered transparent, so the panel’s own surface and glow show through, see
eth_defi.vault_report.charts.render_figure_png()
- text: str
Titles and prominent labels
- muted_text: str
Axis labels and secondary text
- axis: str
Axis lines, zero lines and the panel footer rule
- grid: str
Grid lines; a translucent
rgba()on the dark theme, so it is used by Plotly only
- series_colours: tuple[str, ...]
Categorical series colours in fixed assignment order. Charts assign them by rank, so the length caps how many vaults or groups one chart can show; the order is the one checked for colour vision deficiency, so do not reorder or subset it except from the start
- positive: str
Positive values and the brand accent: gains, above-T-bill averages and the hero returns
- negative: str
Negative values: losses and outflows
- benchmark: str
US Treasury bill reference lines; amber, so the risk-free rate stands apart from the series colours
- neutral: str
Low-emphasis neutral for the summed “Other” group of the TVL and risk and return charts
- glow: tuple[int, int, int, int]
Top-left panel glow colour, RGBA 0-255. The low alpha keeps it a hint of the website’s radial gradient after the Gaussian blur, see
eth_defi.vault_report.branding
- __init__(name, page_background, surface, text, muted_text, axis, grid, series_colours, positive, negative, benchmark, neutral, glow)