Trait ToAlpha

Source
pub trait ToAlpha: Sized {
    // Required method
    fn to_alpha(&self) -> f32;

    // Provided methods
    fn fully_opaque(&self) -> bool { ... }
    fn fully_transparent(&self) -> bool { ... }
}
Expand description

Trait for extracting the alpha channel of a color.

Required Methods§

Source

fn to_alpha(&self) -> f32

Returns a number between 0.0 (fully transparent) to 100.0 (fully opaque).

Provided Methods§

Source

fn fully_opaque(&self) -> bool

Returns true if the alpha of this colour is 100.0

Source

fn fully_transparent(&self) -> bool

Returns true if the alpha of this colour is 0.0

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.

Implementors§