1<HTML 2><HEAD 3><TITLE 4>SDL_Color</TITLE 5><META 6NAME="GENERATOR" 7CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ 8"><LINK 9REL="HOME" 10TITLE="SDL Library Documentation" 11HREF="index.html"><LINK 12REL="UP" 13TITLE="Video" 14HREF="video.html"><LINK 15REL="PREVIOUS" 16TITLE="SDL_Rect" 17HREF="sdlrect.html"><LINK 18REL="NEXT" 19TITLE="SDL_Palette" 20HREF="sdlpalette.html"></HEAD 21><BODY 22CLASS="REFENTRY" 23BGCOLOR="#FFF8DC" 24TEXT="#000000" 25LINK="#0000ee" 26VLINK="#551a8b" 27ALINK="#ff0000" 28><DIV 29CLASS="NAVHEADER" 30><TABLE 31SUMMARY="Header navigation table" 32WIDTH="100%" 33BORDER="0" 34CELLPADDING="0" 35CELLSPACING="0" 36><TR 37><TH 38COLSPAN="3" 39ALIGN="center" 40>SDL Library Documentation</TH 41></TR 42><TR 43><TD 44WIDTH="10%" 45ALIGN="left" 46VALIGN="bottom" 47><A 48HREF="sdlrect.html" 49ACCESSKEY="P" 50>Prev</A 51></TD 52><TD 53WIDTH="80%" 54ALIGN="center" 55VALIGN="bottom" 56></TD 57><TD 58WIDTH="10%" 59ALIGN="right" 60VALIGN="bottom" 61><A 62HREF="sdlpalette.html" 63ACCESSKEY="N" 64>Next</A 65></TD 66></TR 67></TABLE 68><HR 69ALIGN="LEFT" 70WIDTH="100%"></DIV 71><H1 72><A 73NAME="SDLCOLOR" 74></A 75>SDL_Color</H1 76><DIV 77CLASS="REFNAMEDIV" 78><A 79NAME="AEN3082" 80></A 81><H2 82>Name</H2 83>SDL_Color -- Format independent color description</DIV 84><DIV 85CLASS="REFSECT1" 86><A 87NAME="AEN3085" 88></A 89><H2 90>Structure Definition</H2 91><PRE 92CLASS="PROGRAMLISTING" 93>typedef struct{ 94 Uint8 r; 95 Uint8 g; 96 Uint8 b; 97 Uint8 unused; 98} SDL_Color;</PRE 99></DIV 100><DIV 101CLASS="REFSECT1" 102><A 103NAME="AEN3088" 104></A 105><H2 106>Structure Data</H2 107><DIV 108CLASS="INFORMALTABLE" 109><A 110NAME="AEN3090" 111></A 112><P 113></P 114><TABLE 115BORDER="0" 116CLASS="CALSTABLE" 117><TBODY 118><TR 119><TD 120ALIGN="LEFT" 121VALIGN="TOP" 122><TT 123CLASS="STRUCTFIELD" 124><I 125>r</I 126></TT 127></TD 128><TD 129ALIGN="LEFT" 130VALIGN="TOP" 131>Red intensity</TD 132></TR 133><TR 134><TD 135ALIGN="LEFT" 136VALIGN="TOP" 137><TT 138CLASS="STRUCTFIELD" 139><I 140>g</I 141></TT 142></TD 143><TD 144ALIGN="LEFT" 145VALIGN="TOP" 146>Green intensity</TD 147></TR 148><TR 149><TD 150ALIGN="LEFT" 151VALIGN="TOP" 152><TT 153CLASS="STRUCTFIELD" 154><I 155>b</I 156></TT 157></TD 158><TD 159ALIGN="LEFT" 160VALIGN="TOP" 161>Blue intensity</TD 162></TR 163><TR 164><TD 165ALIGN="LEFT" 166VALIGN="TOP" 167><TT 168CLASS="STRUCTFIELD" 169><I 170>unused</I 171></TT 172></TD 173><TD 174ALIGN="LEFT" 175VALIGN="TOP" 176>Unused</TD 177></TR 178></TBODY 179></TABLE 180><P 181></P 182></DIV 183></DIV 184><DIV 185CLASS="REFSECT1" 186><A 187NAME="AEN3109" 188></A 189><H2 190>Description</H2 191><P 192><SPAN 193CLASS="STRUCTNAME" 194>SDL_Color</SPAN 195> describes a color in a format independent way. You can convert a <SPAN 196CLASS="STRUCTNAME" 197>SDL_Color</SPAN 198> to a pixel value for a certain pixel format using <A 199HREF="sdlmaprgb.html" 200><TT 201CLASS="FUNCTION" 202>SDL_MapRGB</TT 203></A 204>.</P 205></DIV 206><DIV 207CLASS="REFSECT1" 208><A 209NAME="AEN3116" 210></A 211><H2 212>See Also</H2 213><P 214><A 215HREF="sdlpixelformat.html" 216><SPAN 217CLASS="STRUCTNAME" 218>SDL_PixelFormat</SPAN 219></A 220>, 221<A 222HREF="sdlsetcolors.html" 223><TT 224CLASS="FUNCTION" 225>SDL_SetColors</TT 226></A 227>, 228<A 229HREF="sdlpalette.html" 230><TT 231CLASS="FUNCTION" 232>SDL_Palette</TT 233></A 234></P 235></DIV 236><DIV 237CLASS="NAVFOOTER" 238><HR 239ALIGN="LEFT" 240WIDTH="100%"><TABLE 241SUMMARY="Footer navigation table" 242WIDTH="100%" 243BORDER="0" 244CELLPADDING="0" 245CELLSPACING="0" 246><TR 247><TD 248WIDTH="33%" 249ALIGN="left" 250VALIGN="top" 251><A 252HREF="sdlrect.html" 253ACCESSKEY="P" 254>Prev</A 255></TD 256><TD 257WIDTH="34%" 258ALIGN="center" 259VALIGN="top" 260><A 261HREF="index.html" 262ACCESSKEY="H" 263>Home</A 264></TD 265><TD 266WIDTH="33%" 267ALIGN="right" 268VALIGN="top" 269><A 270HREF="sdlpalette.html" 271ACCESSKEY="N" 272>Next</A 273></TD 274></TR 275><TR 276><TD 277WIDTH="33%" 278ALIGN="left" 279VALIGN="top" 280>SDL_Rect</TD 281><TD 282WIDTH="34%" 283ALIGN="center" 284VALIGN="top" 285><A 286HREF="video.html" 287ACCESSKEY="U" 288>Up</A 289></TD 290><TD 291WIDTH="33%" 292ALIGN="right" 293VALIGN="top" 294>SDL_Palette</TD 295></TR 296></TABLE 297></DIV 298></BODY 299></HTML 300>