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 repreā
15 sentations, with the same interface as SDL::Color.
16
17 new ( -color => )
18
19 "SDL::Color::new" with a "-color" option will construct a new object
20 referencing the passed SDL_Color*.
21
22 new (-r => , -g => , -b => )
23
24 "SDL::Color::new" with "-r,-g,-b" options will construct both a
25 SDL_Color structure, and the associated object with the specified
26 vales.
27
28 new (-pixel =>, -surface =>)
29
30 "SDL::Color::new" with "-pixel,-surface" options will generate a
31 SDL_Color* with the r,g,b values associated with the integer value
32 passed by "-pixel" for the given "-surface"'s format.
33
34 r ( [ red ] ), g( [ green ] ), b( [ blue ] )
35
36 "SDL::Color::r, SDL::Color::g, SDL::Color::b" are accessor methods for
37 the red, green, and blue components respectively. The color value can
38 be set by passing a byte value (0-255) to each function.
39
40 pixel ( surface )
41
42 "SDL::Color::pixel" takes a "SDL::Surface" object and r,g,b values, and
43 returns the integer representation of the closest color for the given
44 surface.
45
47 David J. Goehrig
48
50 perl SDL::Surface
51
52
53
54perl v5.8.8 2006-08-28 SDL::Color(3)