pub struct SemanticColorScale {
pub base: String,
pub rgb: Option<(u8, u8, u8)>,
pub text_emphasis: Option<String>,
pub bg_subtle: Option<String>,
pub border_subtle: Option<String>,
}Expand description
Semantic Bootstrap color variables for one slot.
Fields§
§base: String§rgb: Option<(u8, u8, u8)>§text_emphasis: Option<String>§bg_subtle: Option<String>§border_subtle: Option<String>Implementations§
Source§impl SemanticColorScale
impl SemanticColorScale
Sourcepub fn new(base: impl Into<String>) -> Self
pub fn new(base: impl Into<String>) -> Self
Create a color slot from a base color (a hex string like #0d6efd, or
any CSS color / var(...) reference).
Use the with_* methods to override derived tokens. Prefer them over a
struct literal so new fields can be added without breaking your code.
Sourcepub fn with_rgb(self, rgb: (u8, u8, u8)) -> Self
pub fn with_rgb(self, rgb: (u8, u8, u8)) -> Self
Set the --bs-{color}-rgb triplet explicitly (otherwise derived from a hex base).
Sourcepub fn with_text_emphasis(self, color: impl Into<String>) -> Self
pub fn with_text_emphasis(self, color: impl Into<String>) -> Self
Set --bs-{color}-text-emphasis explicitly.
Sourcepub fn with_bg_subtle(self, color: impl Into<String>) -> Self
pub fn with_bg_subtle(self, color: impl Into<String>) -> Self
Set --bs-{color}-bg-subtle explicitly.
Sourcepub fn with_border_subtle(self, color: impl Into<String>) -> Self
pub fn with_border_subtle(self, color: impl Into<String>) -> Self
Set --bs-{color}-border-subtle explicitly.
Trait Implementations§
Source§impl Clone for SemanticColorScale
impl Clone for SemanticColorScale
Source§fn clone(&self) -> SemanticColorScale
fn clone(&self) -> SemanticColorScale
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SemanticColorScale
impl Debug for SemanticColorScale
Source§impl From<&str> for SemanticColorScale
impl From<&str> for SemanticColorScale
Source§impl PartialEq for SemanticColorScale
impl PartialEq for SemanticColorScale
Source§fn eq(&self, other: &SemanticColorScale) -> bool
fn eq(&self, other: &SemanticColorScale) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SemanticColorScale
Auto Trait Implementations§
impl Freeze for SemanticColorScale
impl RefUnwindSafe for SemanticColorScale
impl Send for SemanticColorScale
impl Sync for SemanticColorScale
impl Unpin for SemanticColorScale
impl UnsafeUnpin for SemanticColorScale
impl UnwindSafe for SemanticColorScale
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.