#[repr(C)]pub struct Rgba {
pub red: f32,
pub green: f32,
pub blue: f32,
pub alpha: f32,
}
Expand description
Fields§
§red: f32
Red channel value, in the [0.0..=1.0]
range.
green: f32
Green channel value, in the [0.0..=1.0]
range.
blue: f32
Blue channel value, in the [0.0..=1.0]
range.
alpha: f32
Alpha channel value, in the [0.0..=1.0]
range.
Implementations§
source§impl Rgba
impl Rgba
sourcepub fn new<C, A>(red: C, green: C, blue: C, alpha: A) -> Rgba
pub fn new<C, A>(red: C, green: C, blue: C, alpha: A) -> Rgba
New from RGB of a the same type and A that can be of a different type.
sourcepub fn set_red<R>(&mut self, red: R)where
R: Into<RgbaComponent>,
pub fn set_red<R>(&mut self, red: R)where
R: Into<RgbaComponent>,
Set the red
component from any type that converts to RgbaComponent
.
sourcepub fn set_green<G>(&mut self, green: G)where
G: Into<RgbaComponent>,
pub fn set_green<G>(&mut self, green: G)where
G: Into<RgbaComponent>,
Set the green
component from any type that converts to RgbaComponent
.
sourcepub fn set_blue<B>(&mut self, blue: B)where
B: Into<RgbaComponent>,
pub fn set_blue<B>(&mut self, blue: B)where
B: Into<RgbaComponent>,
Set the blue
component from any type that converts to RgbaComponent
.
sourcepub fn set_alpha<A>(&mut self, alpha: A)where
A: Into<RgbaComponent>,
pub fn set_alpha<A>(&mut self, alpha: A)where
A: Into<RgbaComponent>,
Set the alpha
component from any type that converts to RgbaComponent
.
sourcepub fn with_red<R>(self, red: R) -> Rgbawhere
R: Into<RgbaComponent>,
pub fn with_red<R>(self, red: R) -> Rgbawhere
R: Into<RgbaComponent>,
Returns a copy of the color with a new red
value.
sourcepub fn with_green<R>(self, green: R) -> Rgbawhere
R: Into<RgbaComponent>,
pub fn with_green<R>(self, green: R) -> Rgbawhere
R: Into<RgbaComponent>,
Returns a copy of the color with a new green
value.
sourcepub fn with_blue<B>(self, blue: B) -> Rgbawhere
B: Into<RgbaComponent>,
pub fn with_blue<B>(self, blue: B) -> Rgbawhere
B: Into<RgbaComponent>,
Returns a copy of the color with a new blue
value.
sourcepub fn with_alpha<A>(self, alpha: A) -> Rgbawhere
A: Into<RgbaComponent>,
pub fn with_alpha<A>(self, alpha: A) -> Rgbawhere
A: Into<RgbaComponent>,
Returns a copy of the color with a new alpha
value.
sourcepub fn transparent(self) -> Rgba
pub fn transparent(self) -> Rgba
Returns a copy of the color with the alpha set to 0
.
Trait Implementations§
source§impl AddAssign for Rgba
impl AddAssign for Rgba
source§fn add_assign(&mut self, rhs: Rgba)
fn add_assign(&mut self, rhs: Rgba)
+=
operation. Read moresource§impl<'de> Deserialize<'de> for Rgba
impl<'de> Deserialize<'de> for Rgba
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Rgba, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Rgba, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl From<PreMulRgba> for Rgba
impl From<PreMulRgba> for Rgba
source§fn from(c: PreMulRgba) -> Self
fn from(c: PreMulRgba) -> Self
source§impl From<Rgba> for GradientStop
impl From<Rgba> for GradientStop
source§impl From<Rgba> for PreMulRgba
impl From<Rgba> for PreMulRgba
source§impl IntoVar<GradientStop> for Rgba
impl IntoVar<GradientStop> for Rgba
source§impl IntoVar<PreMulRgba> for Rgba
impl IntoVar<PreMulRgba> for Rgba
source§impl IntoVar<Rgba> for PreMulRgba
impl IntoVar<Rgba> for PreMulRgba
source§impl MixAdjust for Rgba
impl MixAdjust for Rgba
source§fn mix_normal(self, background: Self) -> Self
fn mix_normal(self, background: Self) -> Self
source§fn mix_multiply(self, background: Self) -> Self
fn mix_multiply(self, background: Self) -> Self
source§fn mix_screen(self, background: Self) -> Self
fn mix_screen(self, background: Self) -> Self
source§fn mix_overlay(self, background: Self) -> Self
fn mix_overlay(self, background: Self) -> Self
source§fn mix_darken(self, background: Self) -> Self
fn mix_darken(self, background: Self) -> Self
source§fn mix_lighten(self, background: Self) -> Self
fn mix_lighten(self, background: Self) -> Self
source§fn mix_colordodge(self, background: Self) -> Self
fn mix_colordodge(self, background: Self) -> Self
source§fn mix_colorburn(self, background: Self) -> Self
fn mix_colorburn(self, background: Self) -> Self
source§fn mix_hardlight(self, background: Self) -> Self
fn mix_hardlight(self, background: Self) -> Self
source§fn mix_softlight(self, background: Self) -> Self
fn mix_softlight(self, background: Self) -> Self
source§fn mix_difference(self, background: Self) -> Self
fn mix_difference(self, background: Self) -> Self
source§fn mix_exclusion(self, background: Self) -> Self
fn mix_exclusion(self, background: Self) -> Self
source§fn mix_saturation(self, background: Self) -> Self
fn mix_saturation(self, background: Self) -> Self
source§fn mix_luminosity(self, background: Self) -> Self
fn mix_luminosity(self, background: Self) -> Self
source§fn lighten<A: Into<Factor>>(self, amount: A) -> Self
fn lighten<A: Into<Factor>>(self, amount: A) -> Self
amount
to the color lightness. Read moresource§fn darken<A: Into<Factor>>(self, amount: A) -> Self
fn darken<A: Into<Factor>>(self, amount: A) -> Self
amount
from the color lightness. Read moresource§fn desaturate<A: Into<Factor>>(self, amount: A) -> Self
fn desaturate<A: Into<Factor>>(self, amount: A) -> Self
amount
from the color saturation. Read moresource§fn with_lightness<L: Into<Factor>>(self, lightness: L) -> Self
fn with_lightness<L: Into<Factor>>(self, lightness: L) -> Self
lightness
.source§fn mix(self, mode: MixBlendMode, background: Self) -> Selfwhere
Self: Sized,
fn mix(self, mode: MixBlendMode, background: Self) -> Selfwhere
Self: Sized,
background
over self
using the mode
.source§impl Serialize for Rgba
impl Serialize for Rgba
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,
source§impl SubAssign for Rgba
impl SubAssign for Rgba
source§fn sub_assign(&mut self, rhs: Rgba)
fn sub_assign(&mut self, rhs: Rgba)
-=
operation. Read moresource§impl Transitionable for Rgba
impl Transitionable for Rgba
impl Copy for Rgba
impl IntoValue<ColorStop> for Rgba
impl IntoValue<GradientStop> for Rgba
impl IntoValue<Hsla> for Rgba
impl IntoValue<Hsva> for Rgba
impl IntoValue<LightDark> for Rgba
impl IntoValue<PreMulRgba> for Rgba
impl IntoValue<Rgba> for Hsla
impl IntoValue<Rgba> for Hsva
impl IntoValue<Rgba> for PreMulRgba
Auto Trait Implementations§
impl Freeze for Rgba
impl RefUnwindSafe for Rgba
impl Send for Rgba
impl Sync for Rgba
impl Unpin for Rgba
impl UnwindSafe for Rgba
Blanket Implementations§
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self
equals other
.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
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)
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>
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>
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