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 whatSDL_SetGammais 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_SetGammaSDL_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
- debian bookworm: libsdl1.2-dev 1.2.15+dfsg2-8 Β· LGPL-2.1-or-later
- nixos 26.05: SDL_sixel 0-unstable-2016-02-06
- nixpkgs unstable: SDL_sixel 0-unstable-2016-02-06
- ubuntu jammy: libsdl1.2-dev 1.2.15+dfsg2-6 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms