pub enum Color {
Named(NamedColor),
Hex(String),
Css(String),
Literal(String),
}Expand description
Strongly-typed badge color input.
The common path is "brightgreen".parse::<Color>(). Color::Literal
remains available as a low-level compatibility escape hatch.
Variants§
Named(NamedColor)
One of the documented Shields named or semantic colors.
Hex(String)
A hexadecimal color literal such as #4c1 or ABC123.
Css(String)
A CSS color literal such as rgb(...), hsl(...), or papayawhip.
Literal(String)
Low-level escape hatch for raw color input compatibility.
Implementations§
Trait Implementations§
Source§impl From<NamedColor> for Color
impl From<NamedColor> for Color
Source§fn from(value: NamedColor) -> Self
fn from(value: NamedColor) -> Self
Converts to this type from the input type.
impl Eq for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnsafeUnpin for Color
impl UnwindSafe for Color
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