Trait bevy_color::color_difference::EuclideanDistance

source ·
pub trait EuclideanDistance: Sized {
    // Required method
    fn distance_squared(&self, other: &Self) -> f32;

    // Provided method
    fn distance(&self, other: &Self) -> f32 { ... }
}
Expand description

Calculate the distance between this and another color as if they were coordinates in a Euclidean space. Alpha is not considered in the distance calculation.

Required Methods§

source

fn distance_squared(&self, other: &Self) -> f32

Distance squared from self to other.

Provided Methods§

source

fn distance(&self, other: &Self) -> f32

Distance from self to other.

Object Safety§

This trait is not object safe.

Implementors§