-
-
14 Oct 2007 17:11:45 UTC
- Distribution: Color-Similarity
- Module version: 0.01
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (559 / 0 / 1)
- Kwalitee
Bus factor: 1- 100.00% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (3.81KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Graphics::ColorObject
- Module::Build
- Test::More
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Color::Similarity - common interface to different Color::Similarity::* modules
SYNOPSIS
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 ] );
METHODS
new
my $s = Color::Similarity->new( $package );
Constructs a new
Color::Similarity
object wrapping the given$package
. The module will not try to load the package, so the caller must have done it already.distance_rgb
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.
convert_rgb
my $c = $s->convert_rgb( $r, $g, $b );
Converts the given RGB triplet to a representation suitable for passing it to
distance
.distance
my $d = $s->distance( $c1, $c2 );
Computes the distance between two colors already in an appropriate representation (either using
convert_rgb
or by alternate means).SEE ALSO
Color::Similarity::Lab, 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.
Module Install Instructions
To install Color::Similarity, copy and paste the appropriate command in to your terminal.
cpanm Color::Similarity
perl -MCPAN -e shell install Color::Similarity
For more information on module installation, please visit the detailed CPAN module installation guide.