pub struct SRGBLinear {
pub r: f32,
pub g: f32,
pub b: f32,
pub alpha: f32,
}Expand description
A color in the sRGB-linear color space.
Fields§
§r: f32The red component.
g: f32The green component.
b: f32The blue component.
alpha: f32The alpha component.
Trait Implementations§
Source§impl Clone for SRGBLinear
impl Clone for SRGBLinear
Source§impl ColorGamut for SRGBLinear
impl ColorGamut for SRGBLinear
Source§impl ColorSpace for SRGBLinear
impl ColorSpace for SRGBLinear
Source§fn channels(&self) -> (&'static str, &'static str, &'static str)
fn channels(&self) -> (&'static str, &'static str, &'static str)
Returns the channel names for this color space.
Source§fn types(&self) -> (ChannelType, ChannelType, ChannelType)
fn types(&self) -> (ChannelType, ChannelType, ChannelType)
Returns the channel types for this color space.
Source§fn resolve_missing(&self) -> Self
fn resolve_missing(&self) -> Self
Resolves missing color components (e.g.
none keywords) in the color.impl Copy for SRGBLinear
Source§impl Debug for SRGBLinear
impl Debug for SRGBLinear
Source§impl<'de> Deserialize<'de> for SRGBLinear
Available on crate feature serde only.
impl<'de> Deserialize<'de> for SRGBLinear
Available on crate feature
serde only.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<A98> for SRGBLinear
impl From<A98> for SRGBLinear
Source§fn from(t: A98) -> SRGBLinear
fn from(t: A98) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<FloatColor> for SRGBLinear
impl From<FloatColor> for SRGBLinear
Source§fn from(color: FloatColor) -> SRGBLinear
fn from(color: FloatColor) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<HSL> for SRGBLinear
impl From<HSL> for SRGBLinear
Source§fn from(t: HSL) -> SRGBLinear
fn from(t: HSL) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<HWB> for SRGBLinear
impl From<HWB> for SRGBLinear
Source§fn from(t: HWB) -> SRGBLinear
fn from(t: HWB) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<LAB> for SRGBLinear
impl From<LAB> for SRGBLinear
Source§fn from(t: LAB) -> SRGBLinear
fn from(t: LAB) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<LABColor> for SRGBLinear
impl From<LABColor> for SRGBLinear
Source§fn from(color: LABColor) -> SRGBLinear
fn from(color: LABColor) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<LCH> for SRGBLinear
impl From<LCH> for SRGBLinear
Source§fn from(t: LCH) -> SRGBLinear
fn from(t: LCH) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<OKLAB> for SRGBLinear
impl From<OKLAB> for SRGBLinear
Source§fn from(t: OKLAB) -> SRGBLinear
fn from(t: OKLAB) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<OKLCH> for SRGBLinear
impl From<OKLCH> for SRGBLinear
Source§fn from(t: OKLCH) -> SRGBLinear
fn from(t: OKLCH) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<P3> for SRGBLinear
impl From<P3> for SRGBLinear
Source§fn from(t: P3) -> SRGBLinear
fn from(t: P3) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<PredefinedColor> for SRGBLinear
impl From<PredefinedColor> for SRGBLinear
Source§fn from(color: PredefinedColor) -> SRGBLinear
fn from(color: PredefinedColor) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<ProPhoto> for SRGBLinear
impl From<ProPhoto> for SRGBLinear
Source§fn from(t: ProPhoto) -> SRGBLinear
fn from(t: ProPhoto) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<RGB> for SRGBLinear
impl From<RGB> for SRGBLinear
Source§fn from(t: RGB) -> SRGBLinear
fn from(t: RGB) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<RGBA> for SRGBLinear
impl From<RGBA> for SRGBLinear
Source§fn from(t: RGBA) -> SRGBLinear
fn from(t: RGBA) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<Rec2020> for SRGBLinear
impl From<Rec2020> for SRGBLinear
Source§fn from(t: Rec2020) -> SRGBLinear
fn from(t: Rec2020) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<SRGB> for SRGBLinear
impl From<SRGB> for SRGBLinear
Source§fn from(rgb: SRGB) -> SRGBLinear
fn from(rgb: SRGB) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<SRGBLinear> for SRGB
impl From<SRGBLinear> for SRGB
Source§fn from(rgb: SRGBLinear) -> SRGB
fn from(rgb: SRGBLinear) -> SRGB
Converts to this type from the input type.
Source§impl From<SRGBLinear> for XYZd65
impl From<SRGBLinear> for XYZd65
Source§fn from(rgb: SRGBLinear) -> XYZd65
fn from(rgb: SRGBLinear) -> XYZd65
Converts to this type from the input type.
Source§impl From<SRGBLinear> for LAB
impl From<SRGBLinear> for LAB
Source§fn from(t: SRGBLinear) -> LAB
fn from(t: SRGBLinear) -> LAB
Converts to this type from the input type.
Source§impl From<SRGBLinear> for LCH
impl From<SRGBLinear> for LCH
Source§fn from(t: SRGBLinear) -> LCH
fn from(t: SRGBLinear) -> LCH
Converts to this type from the input type.
Source§impl From<SRGBLinear> for P3
impl From<SRGBLinear> for P3
Source§fn from(t: SRGBLinear) -> P3
fn from(t: SRGBLinear) -> P3
Converts to this type from the input type.
Source§impl From<SRGBLinear> for OKLAB
impl From<SRGBLinear> for OKLAB
Source§fn from(t: SRGBLinear) -> OKLAB
fn from(t: SRGBLinear) -> OKLAB
Converts to this type from the input type.
Source§impl From<SRGBLinear> for OKLCH
impl From<SRGBLinear> for OKLCH
Source§fn from(t: SRGBLinear) -> OKLCH
fn from(t: SRGBLinear) -> OKLCH
Converts to this type from the input type.
Source§impl From<SRGBLinear> for A98
impl From<SRGBLinear> for A98
Source§fn from(t: SRGBLinear) -> A98
fn from(t: SRGBLinear) -> A98
Converts to this type from the input type.
Source§impl From<SRGBLinear> for ProPhoto
impl From<SRGBLinear> for ProPhoto
Source§fn from(t: SRGBLinear) -> ProPhoto
fn from(t: SRGBLinear) -> ProPhoto
Converts to this type from the input type.
Source§impl From<SRGBLinear> for Rec2020
impl From<SRGBLinear> for Rec2020
Source§fn from(t: SRGBLinear) -> Rec2020
fn from(t: SRGBLinear) -> Rec2020
Converts to this type from the input type.
Source§impl From<SRGBLinear> for XYZd50
impl From<SRGBLinear> for XYZd50
Source§fn from(t: SRGBLinear) -> XYZd50
fn from(t: SRGBLinear) -> XYZd50
Converts to this type from the input type.
Source§impl From<SRGBLinear> for HSL
impl From<SRGBLinear> for HSL
Source§fn from(t: SRGBLinear) -> HSL
fn from(t: SRGBLinear) -> HSL
Converts to this type from the input type.
Source§impl From<SRGBLinear> for HWB
impl From<SRGBLinear> for HWB
Source§fn from(t: SRGBLinear) -> HWB
fn from(t: SRGBLinear) -> HWB
Converts to this type from the input type.
Source§impl From<SRGBLinear> for RGB
impl From<SRGBLinear> for RGB
Source§fn from(t: SRGBLinear) -> RGB
fn from(t: SRGBLinear) -> RGB
Converts to this type from the input type.
Source§impl From<SRGBLinear> for RGBA
impl From<SRGBLinear> for RGBA
Source§fn from(t: SRGBLinear) -> RGBA
fn from(t: SRGBLinear) -> RGBA
Converts to this type from the input type.
Source§impl From<SRGBLinear> for PredefinedColor
impl From<SRGBLinear> for PredefinedColor
Source§fn from(color: SRGBLinear) -> PredefinedColor
fn from(color: SRGBLinear) -> PredefinedColor
Converts to this type from the input type.
Source§impl From<SRGBLinear> for CssColor
impl From<SRGBLinear> for CssColor
Source§fn from(color: SRGBLinear) -> CssColor
fn from(color: SRGBLinear) -> CssColor
Converts to this type from the input type.
Source§impl From<XYZd50> for SRGBLinear
impl From<XYZd50> for SRGBLinear
Source§fn from(t: XYZd50) -> SRGBLinear
fn from(t: XYZd50) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<XYZd65> for SRGBLinear
impl From<XYZd65> for SRGBLinear
Source§fn from(xyz: XYZd65) -> SRGBLinear
fn from(xyz: XYZd65) -> SRGBLinear
Converts to this type from the input type.
Source§impl Interpolate for SRGBLinear
impl Interpolate for SRGBLinear
Source§fn premultiply(&mut self)
fn premultiply(&mut self)
Premultiplies the color by its alpha value.
Source§fn unpremultiply(&mut self, alpha_multiplier: f32)
fn unpremultiply(&mut self, alpha_multiplier: f32)
Un-premultiplies the color by the given alpha multiplier.
Source§fn fill_missing_components(&mut self, other: &Self)
fn fill_missing_components(&mut self, other: &Self)
Fills missing components (represented as NaN) to match the other color to interpolate with.
Source§fn interpolate(&self, p1: f32, other: &Self, p2: f32) -> Self
fn interpolate(&self, p1: f32, other: &Self, p2: f32) -> Self
Interpolates the color with another using the given amounts of each.
Source§fn adjust_powerless_components(&mut self)
fn adjust_powerless_components(&mut self)
Adjusts components that are powerless to be NaN.
Source§fn adjust_hue(&mut self, _: &mut Self, _: HueInterpolationMethod)
fn adjust_hue(&mut self, _: &mut Self, _: HueInterpolationMethod)
Adjusts the color hue according to the given hue interpolation method.
Source§impl JsonSchema for SRGBLinear
Available on crate feature jsonschema only.
impl JsonSchema for SRGBLinear
Available on crate feature
jsonschema only.Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for SRGBLinear
impl PartialEq for SRGBLinear
Source§impl Serialize for SRGBLinear
Available on crate feature serde only.
impl Serialize for SRGBLinear
Available on crate feature
serde only.impl StructuralPartialEq for SRGBLinear
Source§impl TryFrom<&CssColor> for SRGBLinear
impl TryFrom<&CssColor> for SRGBLinear
Source§impl TryFrom<CssColor> for SRGBLinear
impl TryFrom<CssColor> for SRGBLinear
Source§impl<'i, __T: Visit<'i, __T, __V>, __V: ?Sized + Visitor<'i, __T>> Visit<'i, __T, __V> for SRGBLinear
Available on crate feature visitor only.
impl<'i, __T: Visit<'i, __T, __V>, __V: ?Sized + Visitor<'i, __T>> Visit<'i, __T, __V> for SRGBLinear
Available on crate feature
visitor only.Source§const CHILD_TYPES: VisitTypes
const CHILD_TYPES: VisitTypes
The types of values contained within this value and its children.
This is used to skip branches that don’t have any values requested
by the Visitor.
Auto Trait Implementations§
impl Freeze for SRGBLinear
impl RefUnwindSafe for SRGBLinear
impl Send for SRGBLinear
impl Sync for SRGBLinear
impl Unpin for SRGBLinear
impl UnsafeUnpin for SRGBLinear
impl UnwindSafe for SRGBLinear
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.