1SDL::Color(3) User Contributed Perl Documentation SDL::Color(3)
2
3
4
6 SDL::Color - a SDL perl extension
7
9 $color = new SDL::Color ( -r => 0xde, -g => 0xad, -b =>c0 );
10 $color = new SDL::Color -surface => $app, -pixel => $app->pixel($x,$y);
11 $color = new SDL::Color -color => SDL::NewColor(0xff,0xaa,0xdd);
12
14 "SDL::Color" is a wrapper for display format independent color
15 representations, with the same interface as SDL::Color.
16
17 new ( -color => )
18 "SDL::Color::new" with a "-color" option will construct a new object
19 referencing the passed SDL_Color*.
20
21 new (-r => , -g => , -b => )
22 "SDL::Color::new" with "-r,-g,-b" options will construct both a
23 SDL_Color structure, and the associated object with the specified
24 vales.
25
26 new (-pixel =>, -surface =>)
27 "SDL::Color::new" with "-pixel,-surface" options will generate a
28 SDL_Color* with the r,g,b values associated with the integer value
29 passed by "-pixel" for the given "-surface"'s format.
30
31 r ( [ red ] ), g( [ green ] ), b( [ blue ] )
32 "SDL::Color::r, SDL::Color::g, SDL::Color::b" are accessor methods for
33 the red, green, and blue components respectively. The color value can
34 be set by passing a byte value (0-255) to each function.
35
36 pixel ( surface )
37 "SDL::Color::pixel" takes a "SDL::Surface" object and r,g,b values, and
38 returns the integer representation of the closest color for the given
39 surface.
40
42 David J. Goehrig
43
45 perl SDL::Surface
46
47
48
49perl v5.12.0 2010-05-06 SDL::Color(3)