SDL_SetGammaRamp(3)

SDL_SetGammaRamp πŸ’…βœ¨

okay bestie, welcome to the SDL API Reference πŸŽ€ this lil page is all about SDL_SetGammaRamp β€” literally the glow-up button for your display πŸ¦‹


✨ NAME ✨

SDL_SetGammaRamp β€” sets the color gamma lookup tables for the display 🌈


✨ SYNOPSIS ✨

#include "SDL.h"

int SDL_SetGammaRamp(Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable);

✨ DESCRIPTION ✨

so here's the vibe: this function sets the gamma lookup tables for the display, one per color component πŸ’– each table is an array of 256 Uint16 values, and it represents a mapping between the input and the output for that channel. the way it works is: the input is the index into the array, and the output is the 16-bit gamma value sitting at that index, scaled to the output color precision πŸ‘‘

you can pass NULL to any of the channels and that channel just... stays unchanged, no touchy πŸ™ˆ

ngl this one adjusts gamma based on lookup tables β€” if you'd rather have the gamma calculated based on a "gamma function" parameter instead, that's what SDL_SetGamma is for, iykyk 🌸

also, important, fr fr: not all display hardware is able to change gamma πŸ’€ like, some monitors simply said no and that's that.


✨ RETURN VALUE ✨

returns -1 on error β€” or if gamma adjustment just isn't supported 😭


✨ SEE ALSO ✨

  • SDL_SetGamma
  • SDL_GetGammaRamp

k that's the whole page bestie, go forth and fix ur colors πŸ’œ

signing off with the SDL energy 🧚 β€” this one's dated Tue 11 Sep 2001, 23:01 ⭐ periodt πŸ’…

πŸ“¦ where this page comes from