Conver...::XTerm(3pm)

πŸ“¦
version 0.06 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’… Convert::Color::XTerm(3pm) β€” User Contributed Perl Documentation ✨

okay bestie, so this is the manual page for Convert::Color::XTerm, and it's giving "I know every single default color xterm ever ships with" energy. it's part of the User Contributed Perl Documentation, and yes, we're reading a manpage together like it's a group chat. iconic. let's go 🫢


🌈 NAME 🌈

Convert::Color::XTerm β€” the indexed colors used by XTerm. literally just the color numbers, no vibes-based guesswork. πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

you can use it directly, like this:

use Convert::Color::XTerm;

my $red = Convert::Color::XTerm->new( 1 );

or you can slide in via Convert::Color:

use Convert::Color;

my $cyan = Convert::Color->new( 'xterm:14' );

both paths, both slay. ✨


πŸ’œ DESCRIPTION πŸ’œ

so this class is a subclass of Convert::Color::RGB8, and what it does is look up the colors that xterm uses by default. 🌸

heads up bestie: this module is not smart enough to actually parse the XTerm config on your machine, and it does not query a running terminal for its real, actual colors. it just implements the colors that show up as the defaults in the XTerm source code. no cap. πŸ’€

what it does do is implement the complete 256-color model in XTerm. that range breaks down like this:

  • 0-7: the basic VGA colors, dark intensity. and 7 is a "dark" white β€” meaning, a light grey. πŸ™ˆ
  • 8-15: the basic VGA colors, light intensity. and 8 represents a "light" black β€” meaning, a dark grey. πŸ’€
  • 16-231: a 6x6x6 RGB color cube.
    • Since version 0.06: this can also be specified as "rgb(R,G,B)" where each of R, G and B can be 0 to 5, or "0%" to "100%".
  • 232-255: a 24-step greyscale ramp.
    • Since version 0.06: this can also be specified as "grey(GREY)", where GREY is 0 to 23, or "0%" to "100%".

256 colors, fully accounted for, periodt. πŸ‘‘


πŸ¦‹ CONSTRUCTOR πŸ¦‹

✨ new ✨

$color = Convert::Color::XTerm->new( $index )

hands you back a shiny new object representing the color sitting at that index. main character object energy. πŸ’…


🌸 METHODS 🌸

πŸ’– index πŸ’–

$index = $color->index

the index of the XTerm color. that's it, that's the method, and it ate. πŸ“


πŸ‘€ SEE ALSO πŸ‘€

  • Convert::Color β€” color space conversions. your go-to bestie for moving between color spaces. πŸ”₯

🫢 AUTHOR 🫢

Paul Evans <leonerd@leonerd.org.uk> β€” thank you for your service, king. 🌟


and that's the whole page, bestie!! this one shipped with perl v5.32.1, dated 2021-08-23, and it's the Conver...::XTerm(3pm) page in the User Contributed Perl Documentation. read it, love it, go color something. mwah πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from