4 # a module for manipulating SDL_Palette *
6 # Copyright (C) 2000,2002 David J. Goehrig
13 # NB: there is no palette destructor because most of the time the
14 # palette will be owned by a surface, so any palettes you create
15 # with new, won't be destroyed until the program ends!
19 my $class = ref($proto) || $proto;
24 $self = \$image->palette();
26 $self = \SDL::NewPalette(256);
34 return SDL::PaletteNColors($$self);
42 $r = shift; $g = shift; $b = shift;
43 return SDL::PaletteColors($$self,$index,$r,$g,$b);
45 return SDL::PaletteColors($$self,$index);
56 SDL::PaletteColors($$self,$index),$c);
59 SDL::PaletteColors($$self,$index));
70 SDL::PaletteColors($$self,$index),$c);
73 SDL::PaletteColors($$self,$index));
84 SDL::PaletteColors($$self,$index),$c);
87 SDL::PaletteColors($$self,$index));
99 SDL::Palette - a perl extension
103 L<SDL::Palette> provides an interface to the SDL_Palette structures,
104 and can be used to set the color values of an existing palette's indexes.
108 =head2 blue ( index, [value] )
110 Fetches and sets the blue component of the color at index.
112 =head2 green ( index, [value] )
114 Fetches and sets the green component of the color at index.
116 =head2 red ( index, [value] )
118 Fetches and sets the red component of the color at index.
120 =head2 color ( index, [ r, g, b ] )
122 Fetches and sets the RGB, returns an SDL_Color *.
126 Returns the size of the palette.
134 L<perl> L<SDL::Color> L<SDL::Surface>