pods::SDL::Color(3pm)
π NAME π
SDL::Color β a format independent color description, bestie. Like, it describes a color without caring what format you're in. Iconic behavior honestly.
π CATEGORY π
Core, Video, Structure. Yep, all three. She contains multitudes. β¨
π SYNOPSIS π
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
okay so watch this β you start with red (255, 0, 0), then you slam g and b up to 255 and boom, $color is now white. the glow-up is real. π€
π¦ DESCRIPTION π¦
SDL_Color describes a color in a format independent way. That's it, that's the whole vibe. No format drama, no "which color space are we in" discourse. Just a color, described independently. Periodt. π
β¨ METHODS β¨
π new
my $color = SDL::Color->new(255, 0, 0);
The constructor creates a new color with the specified red, green and blue values. You hand her three numbers and she's like "say less" and now you have a color. main character energy fr. π
π 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. One method, two moods β she's flexible like that. π«Ά
π 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 as r, just greener. obviously. πΏ
π 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. And that's the trio, bestie β r, g, b, all matching, all slaying. π΅
π SEE ALSO π
SDL::Surface
go look at SDL::Surface too, she's the one who actually puts your color on the screen. iykyk. π«
πΈ AUTHORS πΈ
See "AUTHORS" in SDL. (the whole SDL squad, not just me π)
ngl this whole page is giving "small but mighty" β four methods, zero nonsense, all vibes. no cap. π§
okay bye bestie, go make something pretty with it! π
this page was brought to you by perl v5.42.0, dated 2024-05-01, and it lives under pods::SDL::Color(3pm) in the pods manual β mwah, catch you on the flip side π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms