Struct ggez::graphics::LinearColor
source · pub struct LinearColor {
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
}
Expand description
A RGBA color in the linear color space, suitable for shoving into a shader.
Fields§
§r: f32
Red component
g: f32
Green component
b: f32
Blue component
a: f32
Alpha component
Trait Implementations§
source§impl Clone for LinearColor
impl Clone for LinearColor
source§fn clone(&self) -> LinearColor
fn clone(&self) -> LinearColor
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 Debug for LinearColor
impl Debug for LinearColor
source§impl<'de> Deserialize<'de> for LinearColor
impl<'de> Deserialize<'de> for LinearColor
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
source§impl From<Color> for LinearColor
impl From<Color> for LinearColor
source§fn from(c: Color) -> Self
fn from(c: Color) -> Self
Convert an (sRGB) Color into a linear color, per https://en.wikipedia.org/wiki/Srgb#The_reverse_transformation
source§impl From<LinearColor> for [f32; 4]
impl From<LinearColor> for [f32; 4]
source§fn from(color: LinearColor) -> Self
fn from(color: LinearColor) -> Self
Converts to this type from the input type.
source§impl From<LinearColor> for Color
impl From<LinearColor> for Color
source§fn from(color: LinearColor) -> Self
fn from(color: LinearColor) -> Self
Converts to this type from the input type.
source§impl From<LinearColor> for Color
impl From<LinearColor> for Color
source§fn from(c: LinearColor) -> Self
fn from(c: LinearColor) -> Self
Converts to this type from the input type.
source§impl PartialEq<LinearColor> for LinearColor
impl PartialEq<LinearColor> for LinearColor
source§fn eq(&self, other: &LinearColor) -> bool
fn eq(&self, other: &LinearColor) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for LinearColor
impl Serialize for LinearColor
impl Copy for LinearColor
impl StructuralPartialEq for LinearColor
Auto Trait Implementations§
impl RefUnwindSafe for LinearColor
impl Send for LinearColor
impl Sync for LinearColor
impl Unpin for LinearColor
impl UnwindSafe for LinearColor
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
source§impl<T> HasMut<T> for T
impl<T> HasMut<T> for T
source§fn retrieve_mut(&mut self) -> &mut T
fn retrieve_mut(&mut self) -> &mut T
Method to retrieve the context type as mutable.