bevy_color::prelude

Trait Alpha

Source
pub trait Alpha: Sized {
    // Required methods
    fn with_alpha(&self, alpha: f32) -> Self;
    fn alpha(&self) -> f32;
    fn set_alpha(&mut self, alpha: f32);

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

Methods for manipulating alpha values.

Required Methods§

Source

fn with_alpha(&self, alpha: f32) -> Self

Return a new version of this color with the given alpha value.

Source

fn alpha(&self) -> f32

Return a the alpha component of this color.

Source

fn set_alpha(&mut self, alpha: f32)

Sets the alpha component of this color.

Provided Methods§

Source

fn is_fully_transparent(&self) -> bool

Is the alpha component of this color less than or equal to 0.0?

Source

fn is_fully_opaque(&self) -> bool

Is the alpha component of this color greater than or equal to 1.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§