Skip to main content

ThemeExt

Trait ThemeExt 

Source
pub trait ThemeExt {
    // Required method
    fn active_theme(&self) -> Theme;
}
Expand description

Read the theme last passed to apply_to_egui.

Widgets call it once per frame and read the colours egui does not model from it; the rest come from ui.visuals(), which apply_to_egui sets from the same theme.

use egui_charts::theme::{Theme, ThemeExt, apply_to_egui};

apply_to_egui(ui.ctx(), &Theme::light());
let theme = ui.active_theme();
assert_eq!(theme, Theme::light());
let _on_accent = theme.ui.accent_text;

Required Methods§

Source

fn active_theme(&self) -> Theme

The theme last applied, or Theme::dark if none has been.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ThemeExt for Context

Source§

impl ThemeExt for Ui

Implementors§