SDL::Color(3pm)

SDL::Color3pm

Format independent color description

Usage

 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

Overview

"SDL_Color" describes a color in a format independent way.

Methods

new

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

The constructor creates a new color with the specified red, green and blue values.

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.

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.

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.

Releases

12 releases since Debian 3.0 (Woody); the text changed 11 times.

  1. 3.0
  2. 3.1
  3. 4.0
  4. 5.0
  5. 6.0
  6. 7
  7. 8
  8. 9
  9. 10
  10. 11
  11. 12
  12. 13

Authors

See "AUTHORS" in SDL.

From libsdl-perl 2.548-5+b1 in Debian 13 (Trixie). Parsed by carta from the page's man source.