pub struct Style {
pub priority: u16,
pub fg_color: Option<u32>,
pub bg_color: Option<u32>,
pub weight: Option<u16>,
pub underline: Option<bool>,
pub italic: Option<bool>,
}
Expand description
A mergeable style. All values except priority are optional.
Note: A None
value represents the absense of preference; in the case of
boolean options, Some(false)
means that this style will override a lower
priority value in the same field.
Fields§
§priority: u16
The priority of this style, in the range (0, 1000). Used to resolve conflicting fields when merging styles. The higher priority wins.
fg_color: Option<u32>
The foreground text color, in ARGB.
bg_color: Option<u32>
The background text color, in ARGB.
weight: Option<u16>
The font-weight, in the range 100-900, interpreted like the CSS font-weight property.
underline: Option<bool>
§italic: Option<bool>
Implementations§
Source§impl Style
impl Style
Sourcepub fn from_syntect_style_mod(style: &SynStyleModifier) -> Self
pub fn from_syntect_style_mod(style: &SynStyleModifier) -> Self
Creates a new Style
by converting from a Syntect::StyleModifier
.
pub fn new<O32, O16, OB>( priority: u16, fg_color: O32, bg_color: O32, weight: O16, underline: OB, italic: OB, ) -> Self
Sourcepub fn default_for_theme(theme: &Theme) -> Self
pub fn default_for_theme(theme: &Theme) -> Self
Returns the default style for the given Theme
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Style
impl<'de> Deserialize<'de> for Style
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. 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