Merge branch 'master' of git.shadowcat.co.uk:SDL-Site
[sdlgit/SDL-Site.git] / pages / SDL-Palette.html-inc
CommitLineData
162a0989 1<div class="pod">
2<!-- INDEX START -->
3<h3 id="TOP">Index</h3>
4
5<ul><li><a href="#NAME">NAME</a></li>
fb9a1059 6<li><a href="#CATEGORY">CATEGORY</a></li>
162a0989 7<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
8<li><a href="#METHODS">METHODS</a>
9<ul><li><a href="#ncolors">ncolors ( )</a></li>
10<li><a href="#colors_index">colors ( index )</a></li>
11<li><a href="#color_index_index">color_index ( index )</a></li>
162a0989 12</ul>
13</li>
c7e8d3c6 14<li><a href="#SEE_ALSO">SEE ALSO</a></li>
15<li><a href="#AUTHORS">AUTHORS</a>
162a0989 16</li>
17</ul><hr />
18<!-- INDEX END -->
19
20<h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
21<div id="NAME_CONTENT">
fb9a1059 22<p>SDL::Palette -- Color palette for 8-bit pixel formats </p>
23
24</div>
25<h1 id="CATEGORY">CATEGORY</h1><p><a href="#TOP" class="toplink">Top</a></p>
26<div id="CATEGORY_CONTENT">
27<p>Core, Video, Structure</p>
162a0989 28
29</div>
30<h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
31<div id="DESCRIPTION_CONTENT">
fb9a1059 32<p>Each pixel in an 8-bit surface is an index into the colors field of the <code>SDL::Palette</code> structure store in <code>SDL::PixelFormat</code>. A <code>SDL::Palette</code>
33should never need to be created manually. It is automatically created when SDL allocates a <code>SDL::PixelFormat</code> for a surface. The colors
34values of a <code>SDL::Surface</code>'s palette can be set with the <code>SDL::Video::set_colors</code>.</p>
162a0989 35
36</div>
37<h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
38<div id="METHODS_CONTENT">
39
40</div>
41<h2 id="ncolors">ncolors ( )</h2>
42<div id="ncolors_CONTENT">
43<p>Fetches the number of colors in palette</p>
44
45</div>
46<h2 id="colors_index">colors ( index )</h2>
47<div id="colors_index_CONTENT">
48<p>Fetches an array of colors in palette</p>
49
50</div>
51<h2 id="color_index_index">color_index ( index )</h2>
52<div id="color_index_index_CONTENT">
53<p>Fetches the SDL_Color at the provide index in palette</p>
54
55</div>
162a0989 56<h1 id="SEE_ALSO">SEE ALSO</h1><p><a href="#TOP" class="toplink">Top</a></p>
57<div id="SEE_ALSO_CONTENT">
55bbf7a2 58<p><a href="SDL-Color.html">SDL::Color</a> <a href="SDL-Surface.html">SDL::Surface</a></p>
162a0989 59
60</div>
c7e8d3c6 61<h1 id="AUTHORS">AUTHORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
62<div id="AUTHORS_CONTENT">
1dbe1697 63<p>See <a href="/SDL.html#AUTHORS">/SDL.html#AUTHORS</a>.</p>
c7e8d3c6 64
65</div>
162a0989 66</div>