Moved Video to SMPGEG. Maybe move this to SDL::Game::Video later
[sdlgit/SDL_perl.git] / lib / SDL / Color.pm
CommitLineData
8fde61e3 1package SDL::Color;
8fde61e3 2use strict;
084b921f 3use warnings;
3e3f41ee 4require Exporter;
5require DynaLoader;
6our @ISA = qw(Exporter DynaLoader);
7bootstrap SDL::Color;
8fde61e3 8
91;
10
3e3f41ee 11__END__
8fde61e3 12
13=pod
14
15=head1 NAME
16
3e3f41ee 17SDL::Color - Format independent color description
8fde61e3 18
19=head1 SYNOPSIS
20
3e3f41ee 21 my $black = SDL::Color->new( 0, 0, 0);
22 my $color = SDL::Color->new(255, 0, 0);
23 my $r = $color->r; # 255
24 my $g = $color->g; # 0
25 my $b = $color->b; # 0
26 $color->g(255);
27 $color->b(255);
28 # $color is now white
8fde61e3 29
30=head1 DESCRIPTION
31
3e3f41ee 32C<SDL_Color> describes a color in a format independent way.
33
34=head1 METHODS
8fde61e3 35
3e3f41ee 36=head2 new ( $r, $g, $b )
8fde61e3 37
3e3f41ee 38The constructor creates a new color with the specified red, green and
39blue values:
8fde61e3 40
3e3f41ee 41 my $color = SDL::Color->new(255, 0, 0);
8fde61e3 42
3e3f41ee 43=head2 r
8fde61e3 44
3e3f41ee 45If passed a value, this method sets the red component of the color;
46if not, it returns the red component of the color:
8fde61e3 47
3e3f41ee 48 my $r = $color->r; # 255
49 $color->r(128);
8fde61e3 50
3e3f41ee 51=head2 g
8fde61e3 52
3e3f41ee 53If passed a value, this method sets the green component of the color;
54if not, it returns the green component of the color:
8fde61e3 55
3e3f41ee 56 my $g = $color->g; # 255
57 $color->g(128);
8fde61e3 58
3e3f41ee 59=head2 b
8fde61e3 60
3e3f41ee 61If passed a value, this method sets the blue component of the color;
62if not, it returns the blue component of the color:
8fde61e3 63
3e3f41ee 64 my $b = $color->b; # 255
65 $color->b(128);
8fde61e3 66
67=head1 SEE ALSO
68
3e3f41ee 69L<SDL::Surface>
8fde61e3 70
71=cut