| Color-Similarity documentation | view source | Contained in the Color-Similarity distribution. |
Color::Similarity::RGB - compute color similarity using the RGB color space
use Color::Similarity::RGB qw(distance rgb2rgb distance_rgb); # the greater the distance, more different the colors my $distance = distance( [ $r1, $g1, $b1 ], [ $r2, $g2, $b2 ] );
Computes color similarity using the RGB color space and Euclidean distance metric.
my $distance = distance( [ $r1, $g1, $b1 ], [ $r2, $g2, $b2 ] );
Synonim for distance_rgb, for consistency with other
Color::Similarity::* modules.
[ $r, $g, $b ] = rgb2rgb( $r, $g, $b );
Silly "conversion" function, for consistency with other
Color::Similarity::* modules.
my $distance = distance_rgb( [ $r1, $g1, $b1 ], [ $r2, $b2, $b2 ] );
Computes the Euclidean distance between two colors in the RGB color space.
Mattia Barbon, <mbarbon@cpan.org>
Copyright (C) 2007, Mattia Barbon
This program is free software; you can redistribute it or modify it under the same terms as Perl itself.
| Color-Similarity documentation | view source | Contained in the Color-Similarity distribution. |