SDL_Color(3)

✨ SDL_Color(3) ✨

okay bestie, welcome to the SDL API Reference πŸ’– this is a page from the SDL manual, and it's literally about colors, so you KNOW we're gonna have fun with it 🌈


πŸŽ€ NAME πŸŽ€

SDL_Color β€” a format independent color description πŸ’… no cap, that's the whole vibe.


🧚 STRUCTURE DEFINITION 🧚

here's the shape of it, character for character, don't @ me:

typedef struct{
  Uint8 r;
  Uint8 g;
  Uint8 b;
  Uint8 unused;
} SDL_Color;

look at her. four little Uint8s. iconic. πŸ‘‘


🌸 STRUCTURE DATA 🌸

  • r β€” red intensity πŸ”₯
  • g β€” green intensity πŸ’š
  • b β€” blue intensity πŸ’™
  • unused β€” unused πŸ™ˆ yeah she's just... there. chilling. not doing anything. main character energy without a storyline.

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the way that SDL_Color works is that it describes a color in a format independent way. like, it's not tied to any one pixel format, she's flexible, she contains multitudes πŸ’œ

and if you wanna turn an SDL_Color into an actual pixel value for a certain pixel format? you use SDL_MapRGB. that's the move. that's the conversion. slay. ✨


πŸ’« SEE ALSO πŸ’«

  • SDL_PixelFormat
  • SDL_SetColors
  • SDL_Palette

kisses, bestie, go forth and color stuff 🫢🌸 this was SDL, dated Tue 11 Sep 2001, 23:01 β€” yeah she's vintage, she's a classic, and she still ate πŸ’…πŸ’–

πŸ“¦ where this page comes from