Expand description
4-part colour data, linear, sRGB colour space
Linear format must be used for colour data uploaded via uniforms or vertex lists. Conversion from sRGB happens in user-space.
This is the expected type for shader inputs, encoded as four f32
values
in RGBA order.
Fields§
§r: f32
§g: f32
§b: f32
§a: f32
Implementations§
source§impl Rgba
impl Rgba
sourcepub const TRANSPARENT: Self = _
pub const TRANSPARENT: Self = _
Transparent black
sourcepub const fn rgba(r: f32, g: f32, b: f32, a: f32) -> Self
pub const fn rgba(r: f32, g: f32, b: f32, a: f32) -> Self
Construct from R-G-B-A components
Values should be between 0 and 1 on a linear scale.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Rgba
impl<'de> Deserialize<'de> for Rgba
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Rgba
impl StructuralPartialEq for Rgba
Auto Trait Implementations§
impl RefUnwindSafe for Rgba
impl Send for Rgba
impl Sync for Rgba
impl Unpin for Rgba
impl UnwindSafe for Rgba
Blanket Implementations§
source§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Cast to integer, truncating Read more
source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Cast to the nearest integer Read more
source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
Cast the floor to an integer Read more