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


Color-Similarity documentation  | view source Contained in the Color-Similarity distribution.

Index


NAME

Top

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

SYNOPSIS

Top

  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

Top

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

FUNCTIONS

Top

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

Top

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

AUTHOR

Top

Mattia Barbon, <mbarbon@cpan.org>

COPYRIGHT

Top


Color-Similarity documentation  | view source Contained in the Color-Similarity distribution.