-
-
19 May 2018 10:58:08 UTC
- Distribution: SDL
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues (97)
- Testers (294 / 131 / 0)
- Kwalitee
Bus factor: 3- 65.12% Coverage
- License: lgpl_2_1
- Perl: v5.8.0
- Activity
24 month- Tools
- Download (2.37MB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- CPAN
- File::ShareDir
- Scalar::Util
- Tie::Simple
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
SDL::Color - Format independent color description
CATEGORY
Core, Video, Structure
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
DESCRIPTION
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.
SEE ALSO
AUTHORS
See "AUTHORS" in SDL.
Module Install Instructions
To install SDL, copy and paste the appropriate command in to your terminal.
cpanm SDL
perl -MCPAN -e shell install SDL
For more information on module installation, please visit the detailed CPAN module installation guide.