Acme::Colour::Fuzzy - give names to arbitrary RGB triplets
# specify colour set, default is VACCC my $fuzzy = Acme::Colour::Fuzzy->new( 'VACCC' ); # list of similar colours, sorted by similarity my @approximations = $fuzzy->colour_approximations( $r, $g, $b, $count ); # made-up name for the colour my $name = $fuzzy->colour_name( $r, $g, $b );
This module uses sophisticated colour-distance metrics and some made-up computations to give a likely name to an arbitrary RGB triplet.
my $fuzzy = Acme::Colour::Fuzzy->new( $colour_set );
Creates a new Acme::Colour::Fuzzy object using the specified colour set. The coolour set can be any backend for Graphic::ColorNames with 'VACCC' as default.
Acme::Colour::Fuzzy
Graphic::ColorNames
my @approximations = $fuzzy->colour_approximations( $r, $g, $b, $count );
Returns a list of at most $count colours similar to the given one. Each element of the list is an hash with the following structure:
$count
{ name => 'Red', # name taken from Graphics::ColourNames distance => 7.1234567, rgb => [ 255, 0, 0 ], }
my $name = $fuzzy->colour_name( $r, $g, $b );
Makes up a colour name using the data computed by colour_approximations.
colour_approximations
Color::Distance::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 Acme::Colour::Fuzzy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Acme::Colour::Fuzzy
CPAN shell
perl -MCPAN -e shell install Acme::Colour::Fuzzy
For more information on module installation, please visit the detailed CPAN module installation guide.