Expand description
Theme: the colours and scales of the UI and the chart.
A Theme is a plain value with public fields. Start from a preset
(Theme::dark, the default, Theme::light or Theme::high_contrast),
change the fields you need, and pass it to apply_to_egui, once at startup
and again after every change.
use egui::Color32;
use egui_charts::theme::{Theme, apply_to_egui};
let mut theme = Theme::dark().with_accent(Color32::from_rgb(255, 120, 0));
theme.chart.candle_up = Color32::from_rgb(0, 160, 120);
apply_to_egui(ctx, &theme);Structs§
- Chart
Colors - Colours of the chart surface.
- Radii
- Corner radius scale, in points.
- Spacing
- Spacing scale, in points.
- Text
Sizes - Font sizes, in points.
- Theme
- The colours and scales of the UI and the chart.
- UiColors
- Colours of the UI chrome.
Traits§
- Theme
Ext - Read the theme last passed to
apply_to_egui.
Functions§
- apply_
to_ egui - Apply
themeto egui’s visuals and store it forThemeExt::active_theme. Also install Roboto ahead of the application’s proportional fonts. - presets
- Every preset with its name: “dark”, “light” and “high-contrast”.