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.
distance_rgb
Color::Similarity::*
[ $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.
Color::Similarity, Color::Similarity::RGB, Color::Similarity::HCL
Mattia Barbon, <mbarbon@cpan.org>
<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.
To install Color::Similarity, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Color::Similarity
CPAN shell
perl -MCPAN -e shell install Color::Similarity
For more information on module installation, please visit the detailed CPAN module installation guide.