Trait zng::color::LightDarkVarExt

source ·
pub trait LightDarkVarExt {
    // Required methods
    fn rgba(&self) -> impl Var<Rgba>;
    fn rgba_map<T>(
        &self,
        map: impl FnMut(Rgba) -> T + Send + 'static,
    ) -> impl Var<T>
       where T: VarValue;
    fn rgba_into<T>(&self) -> impl Var<T>
       where T: VarValue + From<Rgba>;
    fn map_rgba(
        &self,
        map: impl FnMut(LightDark) -> LightDark + Send + 'static,
    ) -> impl Var<Rgba>;
    fn map_rgba_into<T>(
        &self,
        map: impl FnMut(LightDark) -> LightDark + Send + 'static,
    ) -> impl Var<T>
       where T: VarValue + From<Rgba>;
    fn shade_fct(&self, fct: impl Into<Factor>) -> impl Var<Rgba>;
    fn shade_fct_into<T>(&self, fct: impl Into<Factor>) -> impl Var<T>
       where T: VarValue + From<Rgba>;
    fn shade(&self, shade: i8) -> impl Var<Rgba>;
    fn shade_into<T>(&self, shade: i8) -> impl Var<T>
       where T: VarValue + From<Rgba>;
}
Expand description

Extension methods for impl Var<LightDark>.

Required Methods§

source

fn rgba(&self) -> impl Var<Rgba>

Gets a contextualized var that maps to LightDark::rgba.

source

fn rgba_map<T>( &self, map: impl FnMut(Rgba) -> T + Send + 'static, ) -> impl Var<T>
where T: VarValue,

Gets a contextualized var that maps to LightDark::rgba and map.

source

fn rgba_into<T>(&self) -> impl Var<T>
where T: VarValue + From<Rgba>,

Gets a contextualized var that maps to LightDark::rgba converted into T.

source

fn map_rgba( &self, map: impl FnMut(LightDark) -> LightDark + Send + 'static, ) -> impl Var<Rgba>

Gets a contextualized var that maps using map and then to LightDark::rgba.

source

fn map_rgba_into<T>( &self, map: impl FnMut(LightDark) -> LightDark + Send + 'static, ) -> impl Var<T>
where T: VarValue + From<Rgba>,

Gets a contextualized var that maps using map and then into T.

source

fn shade_fct(&self, fct: impl Into<Factor>) -> impl Var<Rgba>

Gets a contextualized var that maps to LightDark::shade_fct and then to LightDark::rgba.

source

fn shade_fct_into<T>(&self, fct: impl Into<Factor>) -> impl Var<T>
where T: VarValue + From<Rgba>,

Gets a contextualized var that maps to LightDark::shade_fct and then to LightDark::rgba and then into T.

source

fn shade(&self, shade: i8) -> impl Var<Rgba>

Gets a contextualized var that maps to LightDark::shade and then to LightDark::rgba.

  • +1 - Hovered.
  • +2 - Pressed.
source

fn shade_into<T>(&self, shade: i8) -> impl Var<T>
where T: VarValue + From<Rgba>,

Gets a contextualized var that maps to LightDark::shade and then to LightDark::rgba and then into T.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<V> LightDarkVarExt for V
where V: Var<LightDark>,