pub struct Style {
pub fg: Option<String>,
pub bg: Option<String>,
pub bold: bool,
pub italic: bool,
pub text_decoration: TextDecoration,
}Expand description
A style for syntax highlighting.
A style defines the visual appearance of a highlight scope, including colors, font weight, and text decoration.
§Examples
Creating a style with foreground color and bold text:
use lumis::themes::Style;
let style = Style {
fg: Some("#ff79c6".to_string()),
bold: true,
..Default::default()
};Creating a style with background color and italic text:
use lumis::themes::Style;
let style = Style {
bg: Some("#282a36".to_string()),
italic: true,
..Default::default()
};Creating a style with text decoration:
use lumis::themes::{Style, TextDecoration, UnderlineStyle};
let style = Style {
text_decoration: TextDecoration {
underline: UnderlineStyle::Wavy,
strikethrough: true,
},
..Default::default()
};Fields§
§fg: Option<String>The foreground color in hex format (e.g., “#ff79c6”).
bg: Option<String>The background color in hex format (e.g., “#282a36”).
bold: boolWhether to make the text bold.
italic: boolWhether to make the text italic.
text_decoration: TextDecorationText decoration (underline style and strikethrough).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Style
impl<'de> Deserialize<'de> for Style
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Style, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Style, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Style
impl Serialize for Style
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Style
impl StructuralPartialEq for Style
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnwindSafe for Style
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