/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

  1. =pod
  2. =head1 NAME
  3. SDL::Color - Format independent color description
  4. =head2 CATEGORY
  5. Core, Video, Structure
  6. =head1 SYNOPSIS
  7. my $black = SDL::Color->new(0, 0, 0);
  8. my $color = SDL::Color->new(255, 0, 0);
  9. my $r = $color->r; # 255
  10. my $g = $color->g; # 0
  11. my $b = $color->b; # 0
  12. $color->g(255);
  13. $color->b(255);
  14. # $color is now white
  15. =head1 DESCRIPTION
  16. C<SDL_Color> describes a color in a format independent way.
  17. =head1 METHODS
  18. =head2 new
  19. my $color = SDL::Color->new(255, 0, 0);
  20. The constructor creates a new color with the specified red, green and blue values.
  21. =head2 r
  22. my $r = $color->r;
  23. $color->r(128);
  24. If passed a value, this method sets the red component of the color;
  25. if not, it returns the red component of the color.
  26. =head2 g
  27. my $g = $color->g;
  28. $color->g(128);
  29. If passed a value, this method sets the green component of the color;
  30. if not, it returns the green component of the color.
  31. =head2 b
  32. my $b = $color->b;
  33. $color->b(128);
  34. If passed a value, this method sets the blue component of the color;
  35. if not, it returns the blue component of the color.
  36. =head1 SEE ALSO
  37. L<SDL::Surface>
  38. =head1 AUTHORS
  39. See L<SDL/AUTHORS>.
  40. =cut