pub struct ResolvedColor {
pub red: f32,
pub green: f32,
pub blue: f32,
pub headroom: f32,
pub opacity: f32,
}Expand description
Represents a resolved color in linear sRGB color space with extended range support.
This struct stores color components in linear RGB values (0.0-1.0 for standard sRGB, values outside this range represent colors in extended color spaces like P3).
Fields§
§red: f32Red component in linear RGB (0.0-1.0 for sRGB, <0 or >1 for P3)
green: f32Green component in linear RGB (0.0-1.0 for sRGB, <0 or >1 for P3)
blue: f32Blue component in linear RGB (0.0-1.0 for sRGB, <0 or >1 for P3)
headroom: f32Extended color range headroom value (positive values allow for HDR colors)
opacity: f32Opacity/alpha channel (0.0 = transparent, 1.0 = opaque)
Implementations§
Source§impl ResolvedColor
impl ResolvedColor
Sourcepub fn from_srgb(color: Srgb) -> Self
pub fn from_srgb(color: Srgb) -> Self
Creates a resolved color from an sRGB color with default metadata.
Sourcepub fn to_srgb(&self) -> Srgb
pub fn to_srgb(&self) -> Srgb
Converts this resolved color back into sRGB space (with gamma correction).
Sourcepub fn from_oklch(oklch: Oklch, headroom: f32, opacity: f32) -> Self
pub fn from_oklch(oklch: Oklch, headroom: f32, opacity: f32) -> Self
Creates a resolved color from an OKLCH color with the provided metadata.
Sourcepub const fn with_opacity(self, opacity: f32) -> Self
pub const fn with_opacity(self, opacity: f32) -> Self
Returns a copy of this color with the provided opacity.
Sourcepub const fn with_headroom(self, headroom: f32) -> Self
pub const fn with_headroom(self, headroom: f32) -> Self
Returns a copy of this color with the provided headroom value.
Trait Implementations§
Source§impl Clone for ResolvedColor
impl Clone for ResolvedColor
Source§fn clone(&self) -> ResolvedColor
fn clone(&self) -> ResolvedColor
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResolvedColor
impl Debug for ResolvedColor
Source§impl From<Oklch> for ResolvedColor
impl From<Oklch> for ResolvedColor
Source§impl From<P3> for ResolvedColor
impl From<P3> for ResolvedColor
Source§impl From<Srgb> for ResolvedColor
impl From<Srgb> for ResolvedColor
Source§impl Signal for ResolvedColor
impl Signal for ResolvedColor
Source§type Output = ResolvedColor
type Output = ResolvedColor
impl Copy for ResolvedColor
Auto Trait Implementations§
impl Freeze for ResolvedColor
impl RefUnwindSafe for ResolvedColor
impl Send for ResolvedColor
impl Sync for ResolvedColor
impl Unpin for ResolvedColor
impl UnwindSafe for ResolvedColor
Blanket Implementations§
Source§impl<S> AnimationExt for Swhere
S: SignalExt,
impl<S> AnimationExt for Swhere
S: SignalExt,
Source§fn animated(self) -> WithMetadata<Self, Animation>where
Self: Sized,
fn animated(self) -> WithMetadata<Self, Animation>where
Self: Sized,
Source§fn with_animation(self, animation: Animation) -> WithMetadata<Self, Animation>where
Self: Sized,
fn with_animation(self, animation: Animation) -> WithMetadata<Self, Animation>where
Self: Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<T> IdentifiableExt for T
impl<T> IdentifiableExt for T
Source§impl<C, Output> IntoSignal<Output> for C
impl<C, Output> IntoSignal<Output> for C
Source§impl<C> SignalExt for Cwhere
C: Signal,
impl<C> SignalExt for Cwhere
C: Signal,
Source§fn map<F, Output>(self, f: F) -> Map<Self, F, Output>
fn map<F, Output>(self, f: F) -> Map<Self, F, Output>
Source§fn cached(self) -> Cached<Self>
fn cached(self) -> Cached<Self>
Source§fn computed(self) -> Computed<Self::Output>where
Self: 'static,
fn computed(self) -> Computed<Self::Output>where
Self: 'static,
Computed container.