Conver...or::X11(3pm)
π Convert::Color::X11 β the perl manual, but make it cute π
okay bestie, so this is Conver...or::X11(3pm) (yes the manpage title is literally truncated like that, it's giving β¨mysteriousβ¨), a User Contributed Perl Documentation page. it's all about calling colors by their government name instead of by their numbers. let's go π
π NAME π
Convert::Color::X11 β named lookup of colors from X11's rgb.txt no cap π
β¨ SYNOPSIS β¨
you can do it directly, like the bold independent main character you are:
use Convert::Color::X11;
my $red = Convert::Color::X11->new( 'red' );
or you can go via Convert::Color, which is the group-project route π«Ά:
use Convert::Color;
my $cyan = Convert::Color->new( 'x11:cyan' );
both work. both slay. pick your fighter.
π¦ DESCRIPTION π¦
so this class is a subclass of Convert::Color::RGB8 (it's in the family, it's just got extra lore), and what it does is let you look up color names β the ones that come from X11's rgb.txt file. that's the whole vibe. names in, colors out. iconic fr fr.
π CLASS METHODS π
π colors
@colors = Convert::Color::X11->colors;
this hands you back a list of all the defined color names, in the order they showed up in the rgb.txt file. the order is preserved, it's not scrambling anything, we respect the timeline πΈ
$num_colors = Convert::Color::X11->colors;
but wait β if you call it in scalar context, you don't get the list, you get the count of how many defined colors there are. one method, two moods. it contains multitudes β¨
π CONSTRUCTOR π
π new
$color = Convert::Color::X11->new( $name );
feed it a $name and it returns a brand new object that represents the named color. that's it, that's the whole ritual, no cap π«Ά
πΈ METHODS πΈ
β name
$name = $color->name;
this gives you back the name of the VGA color. that's what the page says, word for word, so that's what you get β VGA color, periodt π
π₯ SEE ALSO π₯
Convert::Colorβ color space conversions (the whole ecosystem, iykyk)
π AUTHOR π
Paul Evans <leonerd@leonerd.org.uk> β the legend who wrote this, give them their flowers π
lowkey important reminder: this page isperl v5.40.0, dated2024-09-16, and it's part of the User Contributed Perl Documentation set. so if ur reading it on some wildly different perl version... vibe check ur install first bestie π
okay that's the whole page, go forth and name ur colors, mwah πππ¦
π¦ where this page comes from
- ubuntu resolute: libconvert-color-perl 0.18-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libconvert-color-perl 0.18-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms