Enum pax_engine::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 rgb(r: ColorChannel, g: ColorChannel, b: ColorChannel) -> Color
pub fn rgba( r: ColorChannel, g: ColorChannel, b: ColorChannel, a: ColorChannel, ) -> Color
pub fn hsl(h: Rotation, s: ColorChannel, l: ColorChannel) -> Color
pub fn hsla( h: Rotation, s: ColorChannel, l: ColorChannel, a: ColorChannel, ) -> Color
pub fn to_piet_color(&self) -> Color
pub fn from_rgba_0_1(rgba_0_1: [f64; 4]) -> Color
pub fn from_hex(hex: &str) -> Color
pub fn to_rgba_0_1(&self) -> [f64; 4]
pub fn to_hsla_0_1(&self) -> [f64; 4]
Trait Implementations§
source§impl CoercionRules for Color
impl CoercionRules for Color
source§impl<'de> Deserialize<'de> for Color
impl<'de> Deserialize<'de> for Color
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Color, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Color, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl HelperFunctions for Color
impl HelperFunctions for Color
source§impl Interpolatable for Color
impl Interpolatable for Color
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§impl Reflectable for Color
impl Reflectable for Color
source§fn get_import_path() -> String
fn get_import_path() -> String
The import path is the fully namespace-qualified path for a type, like and a Vec. In both cases of Vec,
the import_path will remain the same.
std::vec::Vec
This is distinct from type_id ONLY when the type has generics, like Vec, where
the type_id is distinct across a Vecfn get_self_pascal_identifier() -> String
fn get_type_id() -> TypeId
fn parse_to_manifest( ctx: ParsingContext, ) -> (ParsingContext, Vec<PropertyDefinition>)
fn get_iterable_type_id() -> Option<TypeId>
source§impl Serialize for Color
impl Serialize for Color
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl ToPaxValue for Color
impl ToPaxValue for Color
fn to_pax_value(self) -> PaxValue
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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.