pub struct EditorTheme {
pub background: Color,
pub surface: Color,
pub foreground: Color,
pub selection: Color,
pub comment: Color,
pub red: Color,
pub orange: Color,
pub yellow: Color,
pub green: Color,
pub cyan: Color,
pub purple: Color,
pub pink: Color,
}Expand description
Color theme for the editor.
Provides colors for the background, foreground, selection, and syntax
highlighting. Use EditorTheme::dracula() for the built-in Dracula theme.
Fields§
§background: Color§surface: ColorSlightly-darker fill for chrome (the status bar) so it reads as a distinct surface rather than blending into the document background.
foreground: Color§selection: Color§comment: Color§red: Color§orange: Color§yellow: Color§green: Color§cyan: Color§purple: Color§pink: ColorImplementations§
Source§impl EditorTheme
impl EditorTheme
Sourcepub fn nord() -> Self
pub fn nord() -> Self
The Nord color theme (arctic dark): keywords blue, types teal, strings amber.
Sourcepub fn solarized_light() -> Self
pub fn solarized_light() -> Self
The Solarized Light color theme: keywords magenta, types cyan, strings amber.
Sourcepub fn solarized_dark() -> Self
pub fn solarized_dark() -> Self
The Solarized Dark color theme (companion to solarized_light).
Sourcepub fn gruvbox_dark() -> Self
pub fn gruvbox_dark() -> Self
The Gruvbox Dark color theme: keywords red, types aqua, strings green.
Sourcepub fn tokyo_night() -> Self
pub fn tokyo_night() -> Self
The Tokyo Night color theme (dark): keywords magenta, types cyan.
Sourcepub fn catppuccin_mocha() -> Self
pub fn catppuccin_mocha() -> Self
The Catppuccin Mocha color theme (dark): keywords mauve, types teal.
Sourcepub fn catppuccin_latte() -> Self
pub fn catppuccin_latte() -> Self
The Catppuccin Latte color theme (light): keywords mauve, types teal.
Sourcepub fn by_name(name: &str) -> Option<Self>
pub fn by_name(name: &str) -> Option<Self>
A built-in theme by its config name, or None if unknown.
pub fn color_for_capture(&self, capture: &str) -> Color
pub fn color_for_highlight(&self, highlight_id: usize) -> Color
Trait Implementations§
Source§impl Clone for EditorTheme
impl Clone for EditorTheme
Source§fn clone(&self) -> EditorTheme
fn clone(&self) -> EditorTheme
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EditorTheme
impl Debug for EditorTheme
Auto Trait Implementations§
impl Freeze for EditorTheme
impl RefUnwindSafe for EditorTheme
impl Send for EditorTheme
impl Sync for EditorTheme
impl Unpin for EditorTheme
impl UnsafeUnpin for EditorTheme
impl UnwindSafe for EditorTheme
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.