pub enum ColorKind {
LinearGradient(LinearGradient),
RadialGradient(RadialGradient),
ConicalGradient(ConicalGradient),
SolidColor(SolidColor),
}Expand description
An enum to describe the possible kinds of colors used when rendering various
Layer attributes/properties.
Variants§
LinearGradient(LinearGradient)
A kind of LinearGradient.
RadialGradient(RadialGradient)
A kind of RadialGradient.
ConicalGradient(ConicalGradient)
A kind of ConicalGradient.
SolidColor(SolidColor)
A kind of SolidColor.
Implementations§
Source§impl ColorKind
impl ColorKind
Sourcepub fn get_color_tuple_at(&self, x: u32, y: u32) -> (u8, u8, u8, u8)
pub fn get_color_tuple_at(&self, x: u32, y: u32) -> (u8, u8, u8, u8)
Returns the resolved RGBA tuple for the color at the given pixel coordinates.
Sourcepub fn is_transparent(&self) -> bool
pub fn is_transparent(&self) -> bool
Returns true if self is a SolidColor and fully transparent.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ColorKind
impl<'de> Deserialize<'de> for ColorKind
Source§fn deserialize<D>(
deserializer: D,
) -> Result<ColorKind, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ColorKind, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ConicalGradient> for ColorKind
impl From<ConicalGradient> for ColorKind
Source§fn from(val: ConicalGradient) -> ColorKind
fn from(val: ConicalGradient) -> ColorKind
Converts to this type from the input type.
Source§impl From<LinearGradient> for ColorKind
impl From<LinearGradient> for ColorKind
Source§fn from(val: LinearGradient) -> ColorKind
fn from(val: LinearGradient) -> ColorKind
Converts to this type from the input type.
Source§impl From<RadialGradient> for ColorKind
impl From<RadialGradient> for ColorKind
Source§fn from(val: RadialGradient) -> ColorKind
fn from(val: RadialGradient) -> ColorKind
Converts to this type from the input type.
Source§impl From<SolidColor> for ColorKind
impl From<SolidColor> for ColorKind
Source§fn from(val: SolidColor) -> ColorKind
fn from(val: SolidColor) -> ColorKind
Converts to this type from the input type.
Source§impl Serialize for ColorKind
impl Serialize for ColorKind
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
Auto Trait Implementations§
impl Freeze for ColorKind
impl RefUnwindSafe for ColorKind
impl Send for ColorKind
impl Sync for ColorKind
impl Unpin for ColorKind
impl UnsafeUnpin for ColorKind
impl UnwindSafe for ColorKind
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().