4 # a module for manipulating SDL_Palette *
6 # Copyright (C) 2000,2002 David J. Goehrig
11 # NB: there is no palette destructor because most of the time the
12 # palette will be owned by a surface, so any palettes you create
13 # with new, won't be destroyed until the program ends!
17 my $class = ref($proto) || $proto;
22 $self = \$image->palette();
24 $self = \SDL::NewPalette(256);
32 return SDL::PaletteNColors($$self);
40 $r = shift; $g = shift; $b = shift;
41 return SDL::PaletteColors($$self,$index,$r,$g,$b);
43 return SDL::PaletteColors($$self,$index);
54 SDL::PaletteColors($$self,$index),$c);
57 SDL::PaletteColors($$self,$index));
68 SDL::PaletteColors($$self,$index),$c);
71 SDL::PaletteColors($$self,$index));
82 SDL::PaletteColors($$self,$index),$c);
85 SDL::PaletteColors($$self,$index));
97 SDL::Palette - a perl extension
101 L<SDL::Palette> provides an interface to the SDL_Palette structures,
102 and can be used to set the color values of an existing palette's indexes.
106 =head2 blue ( index, [value] )
108 Fetches and sets the blue component of the color at index.
110 =head2 green ( index, [value] )
112 Fetches and sets the green component of the color at index.
114 =head2 red ( index, [value] )
116 Fetches and sets the red component of the color at index.
118 =head2 color ( index, [ r, g, b ] )
120 Fetches and sets the RGB, returns an SDL_Color *.
124 Returns the size of the palette.
132 L<perl> L<SDL::Color> L<SDL::Surface>