pub struct Color {
pub red: u8,
pub green: u8,
pub blue: u8,
pub alpha: u8,
}Expand description
Representation of the <color> type.
Fields§
§red: u8§green: u8§blue: u8§alpha: u8Implementations§
Trait Implementations§
Source§impl FromStr for Color
impl FromStr for Color
Source§fn from_str(text: &str) -> Result<Self, Error>
fn from_str(text: &str) -> Result<Self, Error>
Parses CSS3 Color from a string.
§Errors
- Returns error if a color has an invalid format.
- Returns error if
<color>is followed by<icccolor>. It’s not supported.
§Notes
- Any non-
hexdigitbytes will be treated as0. - The SVG 1.1 spec has an error.
There should be a
number, not anintegerfor percent values (details). - It also supports 4 digits and 8 digits hex notation from the CSS Color Module Level 4.
Source§impl ToTokens for Color
impl ToTokens for Color
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
impl Copy for Color
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 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