Graphic...:Scheme(3)
π Graphics::Toolkit::Color::Name::Scheme π
okay bestie so this is a manual page from User Contributed Perl Documentation, and we're talking about Graphics::Toolkit::Color::Name::Scheme β literally a name space for color names. that's the whole vibe. let's get into it π
β¨ SYNOPSIS β¨
use Graphics::Toolkit::Color::Name::Scheme;
my $scheme = Graphics::Toolkit::Color::Name::Scheme->new();
$scheme->add_color( $_->{'name'}, $_->{'rgb_values'} ) for @colors;
say for $scheme->all_names();
my $values = $scheme->values_from_name( 'blue' ); # tuple = 3 element ARRAY
my $names = $scheme->names_from_values( $values ); # tuple -> ARRAY of names
my ($names, $distance) = $scheme->closest_name( $values ); # tuple -> \@names, $distance
πΈ DESCRIPTION πΈ
so this module is mainly for internal usage β it models name spaces for HTML, SVG, Pantone ... colors. that's the job, that's the assignment, and it ate π
but you can also use it yourself to create your own set color names, or to give color name constants slightly different values. customizing your lil color world, iconic behavior honestly π¦
π§ ROUTINES π§
β new
Needs no arguments. that's it. that's the whole thing. low maintenance king π
β sub add_color
takes two positional arguments: a color name, and an ARRAY with three RGB values in range of 0 .. 255. no cap, just feed it the name and the numbers π
β all_names
List of all names held by the scheme. the whole roster, the full lineup π
β is_name_taken
Pseudo boolean that tells you if the given name is already held. like, is this name claimed or not bestie π
β values_from_name
Returns the value tuple associated with the name. name in, tuple out β¨
β names_from_values
Returns an ARRAY ref with all names associated with these RGB values, or an empty string if none. so heads up β sometimes it's an array ref, sometimes it's just an empty string. not me noticing that little quirk π
β closest_names
Returns an ARRAY ref with all names associated with RGB values from this scheme that are the closest. Second return value is the distance between these closest names and the given value tuple β which is the first and only parameter, iykyk π«Ά
π SEE ALSO π
Color::LibraryGraphics::ColorNamesLite::All
π COPYRIGHT & LICENSE π
Copyright 2025 Herbert Breunung.
This program is free software; you can redistribute it and/or modify it under same terms as Perl itself.
π AUTHOR π
Herbert Breunung, <lichtkind@cpan.org>
and that's the whole page, bestie!! π big slay to Herbert Breunung for writing it, and this one's running on perl v5.42.0 with a date of 2026-01-17. periodt β¨πΈπ¦
π¦ where this page comes from
- fedora 44: perl-Graphics-Toolkit-Color 1.972-2.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms