pub struct CodeTheme { /* private fields */ }
Expand description
A selected color theme.
Implementations§
Source§impl CodeTheme
impl CodeTheme
Sourcepub fn from_style(style: &Style) -> Self
pub fn from_style(style: &Style) -> Self
Selects either dark or light theme based on the given style.
Sourcepub fn dark(font_size: f32) -> Self
pub fn dark(font_size: f32) -> Self
§Example
use egui_extras::syntax_highlighting::CodeTheme;
let theme = CodeTheme::dark(12.0);
Sourcepub fn light(font_size: f32) -> Self
pub fn light(font_size: f32) -> Self
§Example
use egui_extras::syntax_highlighting::CodeTheme;
let theme = CodeTheme::light(12.0);
Sourcepub fn from_memory(ctx: &Context, style: &Style) -> Self
pub fn from_memory(ctx: &Context, style: &Style) -> Self
Load code theme from egui memory.
There is one dark and one light theme stored at any one time.
Sourcepub fn store_in_memory(self, ctx: &Context)
pub fn store_in_memory(self, ctx: &Context)
Store theme to egui memory.
There is one dark and one light theme stored at any one time.
Trait Implementations§
impl StructuralPartialEq for CodeTheme
Auto Trait Implementations§
impl Freeze for CodeTheme
impl RefUnwindSafe for CodeTheme
impl Send for CodeTheme
impl Sync for CodeTheme
impl Unpin for CodeTheme
impl UnwindSafe for CodeTheme
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more