[][src]Function termimage::util::closest_colour

pub fn closest_colour<P: Index<usize, Output = u8>>(
    to: Rgb<u8>,
    out_of: &[P]
) -> usize

Get the closest colour to the provided one out of the specified list of colours and retirn its index.

The formula is the last one from the Euclidean section in the Color difference article on Wikipedia