/lib/pods/SDL/Color.pod
http://github.com/PerlGameDev/SDL · Unknown · 68 lines · 40 code · 28 blank · 0 comment · 0 complexity · 102b755047d0f856000f9074c7268452 MD5 · raw file
- =pod
- =head1 NAME
- SDL::Color - Format independent color description
- =head2 CATEGORY
- Core, Video, Structure
- =head1 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
- =head1 DESCRIPTION
- C<SDL_Color> describes a color in a format independent way.
- =head1 METHODS
- =head2 new
- my $color = SDL::Color->new(255, 0, 0);
- The constructor creates a new color with the specified red, green and blue values.
- =head2 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.
- =head2 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.
- =head2 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.
- =head1 SEE ALSO
- L<SDL::Surface>
- =head1 AUTHORS
- See L<SDL/AUTHORS>.
- =cut