Trait bevy::color::color_difference::EuclideanDistance

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§

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

Distance squared from self to other.

Provided Methods§

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

Distance from self to other.

Object Safety§

This trait is not object safe.

Implementors§