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
- ubuntu stonking: libsdl-perl 2.548-6build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms