pods::SDL::Color(3pm)

πŸ“¦ version 2.548, in opensuse-leap 16.0

πŸ’– 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