The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Color::Similarity::RGB - compute color similarity using the RGB color space

SYNOPSIS

  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 ] );

DESCRIPTION

Computes color similarity using the RGB color space and Euclidean distance metric.

FUNCTIONS

distance

  my $distance = distance( [ $r1, $g1, $b1 ], [ $r2, $g2, $b2 ] );

Synonim for distance_rgb, for consistency with other Color::Similarity::* modules.

rgb2rgb

  [ $r, $g, $b ] = rgb2rgb( $r, $g, $b );

Silly "conversion" function, for consistency with other Color::Similarity::* modules.

distance_rgb

  my $distance = distance_rgb( [ $r1, $g1, $b1 ], [ $r2, $b2, $b2 ] );

Computes the Euclidean distance between two colors in the RGB color space.

SEE ALSO

Color::Similarity, Color::Similarity::RGB, Color::Similarity::HCL

AUTHOR

Mattia Barbon, <mbarbon@cpan.org>

COPYRIGHT

Copyright (C) 2007, Mattia Barbon

This program is free software; you can redistribute it or modify it under the same terms as Perl itself.