Struct zng_layout::unit::RgbaComponent
source · pub struct RgbaComponent(pub f32);
Expand description
Color functions argument conversion helper.
Don’t use this value directly, if a function takes Into<RgbaComponent>
you can use one of the
types this converts from:
f32
,f64
andFactor
for a value in the0.0
to1.0
range.u8
for a value in the0
to255
range.FactorPercent
for a percentage value.
Tuple Fields§
§0: f32
Trait Implementations§
source§impl Clone for RgbaComponent
impl Clone for RgbaComponent
source§fn clone(&self) -> RgbaComponent
fn clone(&self) -> RgbaComponent
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl From<Factor> for RgbaComponent
impl From<Factor> for RgbaComponent
Color channel value is in the [0..=1] range.
source§fn from(f: Factor) -> RgbaComponent
fn from(f: Factor) -> RgbaComponent
Converts to this type from the input type.
source§impl From<FactorPercent> for RgbaComponent
impl From<FactorPercent> for RgbaComponent
Color channel value is in the [0..=100] range.
source§fn from(p: FactorPercent) -> RgbaComponent
fn from(p: FactorPercent) -> RgbaComponent
Converts to this type from the input type.
source§impl From<f32> for RgbaComponent
impl From<f32> for RgbaComponent
Color channel value is in the [0..=1] range.
source§fn from(f: f32) -> RgbaComponent
fn from(f: f32) -> RgbaComponent
Converts to this type from the input type.
source§impl From<f64> for RgbaComponent
impl From<f64> for RgbaComponent
Color channel value is in the [0..=1] range.
source§fn from(f: f64) -> RgbaComponent
fn from(f: f64) -> RgbaComponent
Converts to this type from the input type.
source§impl From<u8> for RgbaComponent
impl From<u8> for RgbaComponent
Color channel value is in the [0..=255] range.
source§fn from(u: u8) -> RgbaComponent
fn from(u: u8) -> RgbaComponent
Converts to this type from the input type.
impl Copy for RgbaComponent
Auto Trait Implementations§
impl Freeze for RgbaComponent
impl RefUnwindSafe for RgbaComponent
impl Send for RgbaComponent
impl Sync for RgbaComponent
impl Unpin for RgbaComponent
impl UnwindSafe for RgbaComponent
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
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more