cushy::styles

Trait ProtoColor

Source
pub trait ProtoColor: Sized {
    // Required methods
    fn hue(&self) -> OklabHue;
    fn saturation(&self) -> Option<ZeroToOne>;

    // Provided method
    fn into_source(
        self,
        saturation_if_not_provided: impl Into<ZeroToOne>,
    ) -> ColorSource { ... }
}
Expand description

A type that can be interpretted as a hue or hue and saturation.

Required Methods§

Source

fn hue(&self) -> OklabHue

Returns the hue of this prototype color.

Source

fn saturation(&self) -> Option<ZeroToOne>

Returns the saturation of this prototype color, if available.

Provided Methods§

Source

fn into_source( self, saturation_if_not_provided: impl Into<ZeroToOne>, ) -> ColorSource

Returns a color source built from this prototype color

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ProtoColor for f32

Source§

impl<Hue, Saturation> ProtoColor for (Hue, Saturation)
where Hue: Into<OklabHue> + Copy, Saturation: Into<ZeroToOne> + Copy,

Implementors§