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 is perl v5.40.0, dated 2024-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