Trait cushy::styles::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

Object Safety§

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§