SDL::Color - a SDL perl extension |
SDL::Color - a SDL perl extension
$color = new SDL::Color ( -r => 0xde, -g => 0xad, -b =>c0 ); $color = new SDL::Color -surface => $app, -pixel => $app->pixel($x,$y); $color = new SDL::Color -color => SDL::NewColor(0xff,0xaa,0xdd);
SDL::Color
is a wrapper for display format independent color
representations, with the same interface as the SDL::Color manpage.
SDL::Color::new
with a -color
option will construct a new object
referencing the passed SDL_Color*.
SDL::Color::new
with -r,-g,-b
options will construct both a SDL_Color
structure, and the associated object with the specified vales.
SDL::Color::new
with -pixel,-surface
options will generate a SDL_Color*
with the r,g,b values associated with the integer value passed by -pixel
for the given -surface
's format.
SDL::Color::r, SDL::Color::g, SDL::Color::b
are accessor methods for
the red, green, and blue components respectively. The color value can be set
by passing a byte value (0-255) to each function.
SDL::Color::pixel
takes a SDL::Surface
object and r,g,b values, and
returns the integer representation of the closest color for the given surface.
David J. Goehrig
SDL::Color - a SDL perl extension |