pub struct Color(pub [u8; 4]);Expand description
Represents a color with 8-bit RGBA components.
Tuple Fields§
§0: [u8; 4]Implementations§
Source§impl Color
impl Color
Sourcepub const fn transparent() -> Self
pub const fn transparent() -> Self
Creates a new transparent color.
Sourcepub fn with_opacity(self, opacity: u8) -> Self
pub fn with_opacity(self, opacity: u8) -> Self
Apply opacity to alpha channel
Trait Implementations§
impl Copy for Color
Source§impl From<Color> for PremultipliedColorU8
impl From<Color> for PremultipliedColorU8
Source§impl<'i> FromCss<'i> for Color
impl<'i> FromCss<'i> for Color
Source§const VALID_TOKENS: &'static [CssToken]
const VALID_TOKENS: &'static [CssToken]
Returns the list of valid CSS tokens for this type.
Source§fn from_css(input: &mut Parser<'i, '_>) -> ParseResult<'i, Self>
fn from_css(input: &mut Parser<'i, '_>) -> ParseResult<'i, Self>
Parses the type from a
Parser instance.Source§fn from_str(source: &'i str) -> ParseResult<'i, Self>where
Self: Sized,
fn from_str(source: &'i str) -> ParseResult<'i, Self>where
Self: Sized,
Helper function to parse the type from a string.
Source§const EXPECT_MESSAGE: CssExpectedMessage = CssExpectedMessage::OneValue
const EXPECT_MESSAGE: CssExpectedMessage = CssExpectedMessage::OneValue
Message template used when building parse errors for this type.
impl StructuralPartialEq for Color
Source§impl TailwindPropertyParser for Color
impl TailwindPropertyParser 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