Trait bevy::color::Alpha

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§

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

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

fn alpha(&self) -> f32

Return a the alpha component of this color.

fn set_alpha(&mut self, alpha: f32)

Sets the alpha component of this color.

Provided Methods§

fn is_fully_transparent(&self) -> bool

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

fn is_fully_opaque(&self) -> bool

Is the alpha component of this color greater than or equal to 1.0?

Object Safety§

This trait is not object safe.



impl Alpha for Color


impl Alpha for Hsla


impl Alpha for Hsva


impl Alpha for Hwba


impl Alpha for Laba


impl Alpha for Lcha


impl Alpha for LinearRgba


impl Alpha for Oklaba


impl Alpha for Oklcha


impl Alpha for Srgba


impl Alpha for Xyza