pods::SDL::Color(3pm)

πŸ’– NAME πŸ’–

SDL::Color β€” a format independent color description, bestie. it's giving "i contain a color and i don't care what format you want it in" πŸ’…

🌈 CATEGORY 🌈

Core, Video, Structure β€” yeah she's core, she's video, she's a structure. main character energy fr fr πŸ‘‘


✨ SYNOPSIS ✨

okay so real quick, here's the whole vibe in one go:

my $black = SDL::Color->new(0, 0, 0);
my $color = SDL::Color->new(255, 0, 0);
my $r = $color->r; # 255
my $g = $color->g; # 0
my $b = $color->b; # 0
$color->g(255);
$color->b(255);
# $color is now white

like… you literally watch it go from red to white in four lines. ate. πŸ”₯


πŸ¦‹ DESCRIPTION πŸ¦‹

SDL_Color describes a color in a format independent way. that's it, that's the whole personality β€” no format drama, no conversions, just a color doing its thing πŸŽ€


πŸ’œ METHODS πŸ’œ

🌸 new

my $color = SDL::Color->new(255, 0, 0);

The constructor creates a new color with the specified red, green and blue values. three numbers walk in, a color walks out. iconic behavior honestly 🫢

πŸ“ r

my $r = $color->r;
$color->r(128);

If passed a value, this method sets the red component of the color; if not, it returns the red component of the color. so like… it's a getter AND a setter, she contains multitudes 😭

🧚 g

my $g = $color->g;
$color->g(128);

If passed a value, this method sets the green component of the color; if not, it returns the green component of the color. same deal, green flavored πŸ’š

πŸŽ€ b

my $b = $color->b;
$color->b(128);

If passed a value, this method sets the blue component of the color; if not, it returns the blue component of the color. blue era, no cap πŸ’™


πŸ‘‘ SEE ALSO πŸ‘‘

  • SDL::Surface β€” go look, bestie, iykyk ⭐

🌟 AUTHORS 🌟

See "AUTHORS" in SDL. πŸ’–


ngl the whole page was tiny but she's still lowkey essential β€” no skips πŸ™ˆ

kisses, this was pods::SDL::Color(3pm) from the User Contributed Perl Documentation, perl v5.42.3, dated 2026-08-19 β€” slay, bye! πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from