Enum pax_runtime_api::Color
source · pub enum Color {
Show 30 variants
rgb(ColorChannel, ColorChannel, ColorChannel),
rgba(ColorChannel, ColorChannel, ColorChannel, ColorChannel),
hsl(Rotation, ColorChannel, ColorChannel),
hsla(Rotation, ColorChannel, ColorChannel, ColorChannel),
SLATE,
GRAY,
ZINC,
NEUTRAL,
STONE,
RED,
ORANGE,
AMBER,
YELLOW,
LIME,
GREEN,
EMERALD,
TEAL,
CYAN,
SKY,
BLUE,
INDIGO,
VIOLET,
PURPLE,
FUCHSIA,
PINK,
ROSE,
BLACK,
WHITE,
TRANSPARENT,
NONE,
}
Variants§
rgb(ColorChannel, ColorChannel, ColorChannel)
Models a color in the RGB space, with an alpha channel of 100%
rgba(ColorChannel, ColorChannel, ColorChannel, ColorChannel)
Models a color in the RGBA space
hsl(Rotation, ColorChannel, ColorChannel)
Models a color in the HSL space.
hsla(Rotation, ColorChannel, ColorChannel, ColorChannel)
Models a color in the HSLA space.
SLATE
GRAY
ZINC
NEUTRAL
STONE
RED
ORANGE
AMBER
YELLOW
LIME
GREEN
EMERALD
TEAL
CYAN
SKY
BLUE
INDIGO
VIOLET
PURPLE
FUCHSIA
PINK
ROSE
BLACK
WHITE
TRANSPARENT
NONE
Implementations§
source§impl Color
impl Color
pub fn to_piet_color(&self) -> Color
pub fn from_rgba_0_1(rgba_0_1: [f64; 4]) -> Self
pub fn to_rgba_0_1(&self) -> [f64; 4]
Trait Implementations§
source§impl<'de> Deserialize<'de> for Color
impl<'de> Deserialize<'de> for Color
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
source§impl Interpolatable for Color
impl Interpolatable for Color
fn interpolate(&self, other: &Self, t: f64) -> Self
source§impl Into<ColorMessage> for &Color
impl Into<ColorMessage> for &Color
source§fn into(self) -> ColorMessage
fn into(self) -> ColorMessage
Converts this type into the (usually inferred) input type.
source§impl PartialEq<ColorMessage> for Color
impl PartialEq<ColorMessage> for Color
source§fn eq(&self, other: &ColorMessage) -> bool
fn eq(&self, other: &ColorMessage) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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
source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.