#[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) -> Rgba
fn from(c: PreMulRgba) -> Rgba
source§impl From<Rgba> for BorderSide
impl From<Rgba> for BorderSide
source§fn from(color: Rgba) -> BorderSide
fn from(color: Rgba) -> BorderSide
Solid color.
source§impl From<Rgba> for BorderSides
impl From<Rgba> for BorderSides
source§fn from(color: Rgba) -> BorderSides
fn from(color: Rgba) -> BorderSides
All sides solid color.
source§impl From<Rgba> for GradientStop
impl From<Rgba> for GradientStop
source§fn from(positional_color: Rgba) -> GradientStop
fn from(positional_color: Rgba) -> GradientStop
Conversion to positional color.
source§impl From<Rgba> for PreMulRgba
impl From<Rgba> for PreMulRgba
source§fn from(c: Rgba) -> PreMulRgba
fn from(c: Rgba) -> PreMulRgba
source§impl IntoVar<BorderSide> for Rgba
impl IntoVar<BorderSide> for Rgba
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl IntoVar<BorderSides> for Rgba
impl IntoVar<BorderSides> for Rgba
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl IntoVar<GradientStop> for Rgba
impl IntoVar<GradientStop> for Rgba
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl IntoVar<PreMulRgba> for Rgba
impl IntoVar<PreMulRgba> for Rgba
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§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: Rgba) -> Rgba
fn mix_normal(self, background: Rgba) -> Rgba
source§fn mix_multiply(self, background: Rgba) -> Rgba
fn mix_multiply(self, background: Rgba) -> Rgba
source§fn mix_screen(self, background: Rgba) -> Rgba
fn mix_screen(self, background: Rgba) -> Rgba
source§fn mix_overlay(self, background: Rgba) -> Rgba
fn mix_overlay(self, background: Rgba) -> Rgba
source§fn mix_darken(self, background: Rgba) -> Rgba
fn mix_darken(self, background: Rgba) -> Rgba
source§fn mix_lighten(self, background: Rgba) -> Rgba
fn mix_lighten(self, background: Rgba) -> Rgba
source§fn mix_colordodge(self, background: Rgba) -> Rgba
fn mix_colordodge(self, background: Rgba) -> Rgba
source§fn mix_colorburn(self, background: Rgba) -> Rgba
fn mix_colorburn(self, background: Rgba) -> Rgba
source§fn mix_hardlight(self, background: Rgba) -> Rgba
fn mix_hardlight(self, background: Rgba) -> Rgba
source§fn mix_softlight(self, background: Rgba) -> Rgba
fn mix_softlight(self, background: Rgba) -> Rgba
source§fn mix_difference(self, background: Rgba) -> Rgba
fn mix_difference(self, background: Rgba) -> Rgba
source§fn mix_exclusion(self, background: Rgba) -> Rgba
fn mix_exclusion(self, background: Rgba) -> Rgba
source§fn mix_saturation(self, background: Rgba) -> Rgba
fn mix_saturation(self, background: Rgba) -> Rgba
source§fn mix_luminosity(self, background: Rgba) -> Rgba
fn mix_luminosity(self, background: Rgba) -> Rgba
source§fn darken<A>(self, amount: A) -> Rgba
fn darken<A>(self, amount: A) -> Rgba
amount
from the color lightness. Read moresource§fn desaturate<A>(self, amount: A) -> Rgba
fn desaturate<A>(self, amount: A) -> Rgba
amount
from the color saturation. Read moresource§fn with_lightness<L>(self, lightness: L) -> Rgba
fn with_lightness<L>(self, lightness: L) -> Rgba
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 PxToWr for Rgba
impl PxToWr for Rgba
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<BorderSide> for Rgba
impl IntoValue<BorderSides> 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 AnsiColor
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§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
)source§impl<T> DataNoteValue for T
impl<T> DataNoteValue for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§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> 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>
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
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>
ReadEndian::read_from_little_endian()
.