14 Oct 2007 17:11:45 UTC
- Distribution: Color-Similarity
- Module version: 0.01
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (559 / 0 / 1)
- KwaliteeBus factor: 1
- 100.00% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity24 month
- Download (3.81KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
Color::Similarity - common interface to different Color::Similarity::* modules
use Color::Similarity; my $package = ...; # for example Color::Similarity::HCL my $s = Color::Similarity->new( $package ); my $d1 = $s->distance( [ $r1, $g1, $b1 ], [ $r2, $g2, $b2 ] );
my $s = Color::Similarity->new( $package );
Constructs a new
Color::Similarityobject wrapping the given
$package. The module will not try to load the package, so the caller must have done it already.
my $d = $s->distance_rgb( [ $r1, $g1, $b1 ], [ $r2, $g2, $b2 ] );
Converts the RGB triplets to the appropriate representation (usually a different colorspace) and computes their distance.
my $c = $s->convert_rgb( $r, $g, $b );
Converts the given RGB triplet to a representation suitable for passing it to
my $d = $s->distance( $c1, $c2 );
Computes the distance between two colors already in an appropriate representation (either using
convert_rgbor by alternate means).
Copyright (C) 2007, Mattia Barbon
This program is free software; you can redistribute it or modify it under the same terms as Perl itself.
Module Install Instructions
To install Color::Similarity, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Color::Similarity
For more information on module installation, please visit the detailed CPAN module installation guide.