TTF_GetTextColor(3)
π TTF_GetTextColor(3) π
okay bestie, welcome to the SDL_ttf3 FUNCTIONS corner of the manual, and today's main character is TTF_GetTextColor β¨
πΈ NAME πΈ
TTF_GetTextColor β get the color of a text object, no cap π¨
π HEADER FILE π
Defined in SDL3_ttf/SDL_ttf.h
β¨ SYNOPSIS β¨
#include "SDL3_ttf/SDL_ttf.h"
bool TTF_GetTextColor(TTF_Text *text, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
π«Ά FUNCTION PARAMETERS π«Ά
textβ theTTF_Textyou wanna query, like, the actual text object in question πrβ a pointer that gets filled in with the red color value, range0-255, and it may beNULL(yes, you can just not care about red, she's optional)gβ a pointer that gets filled in with the green color value, range0-255, may beNULLtoo πbβ a pointer that gets filled in with the blue color value, range0-255, may beNULLas well π¦aβ a pointer that gets filled in with the alpha value, range0-255, and yep, may beNULLπ
like, you can pass NULL for any of the color channels you don't gaf about. iconic behavior honestly.
π RETURN VALUE π
Returns true on success or false on failure π and if it fails, call SDL_GetError() for more information, that's where the tea is.
π§ THREAD SAFETY π§
This function should be called on the thread that created the text. like, stay loyal to your thread bestie, don't be out here calling it from a random one π
β AVAILABILITY β
This function is available since SDL_ttf 3.0.0 β¨ so if you're on anything older... not me finding out the hard way.
π SEE ALSO π
- β’(3)
TTF_GetTextColorFloat(3)- β’(3)
TTF_SetTextColor(3)
lowkey reminder: ther,g,b,apointers all get values in the range0-255, and every single one of them may beNULL. don't forget it, bestie π
sign-off time π this page is from SDL_ttf, version SDL_ttf 3.2.2, and it's giving TTF_GetTextColor(3) energy. go forth and get those colors, you ate π
β¨
π¦ where this page comes from
- debian trixie: libsdl3-ttf-doc 3.2.2+ds-1 Β· Zlib
- fedora 43: SDL3_ttf-devel 3.2.2-2.fc43 Β· Zlib AND MIT
- fedora 43: SDL3_ttf-devel 3.2.2-2.fc43 Β· Zlib AND MIT
- fedora 44: SDL3_ttf-devel 3.2.2-4.fc44 Β· Zlib AND MIT
- fedora 44: SDL3_ttf-devel 3.2.2-4.fc44 Β· Zlib AND MIT
- ubuntu questing: libsdl3-ttf-doc 3.2.2+ds-1
- ubuntu resolute: libsdl3-ttf-doc 3.2.2+ds-1build1 Β· Zlib
- ubuntu stonking: libsdl3-ttf-doc 3.2.2+ds-2 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms