TTF_GetTextColorFloat(3)

πŸ’– TTF_GetTextColorFloat(3) πŸ’–

okay bestie, welcome to the SDL_ttf3 functions corner of the SDL_ttf manual β€” this one's about peeking at what color a text object is rocking. no cap.


🌸 NAME 🌸

TTF_GetTextColorFloat β€” get the color of a text object. that's it, that's the whole job ✨


πŸŽ€ HEADER FILE πŸŽ€

defined in SDL3_ttf/SDL_ttf.h β€” yeah she lives there, go say hi 🫢


✨ SYNOPSIS ✨

#include "SDL3_ttf/SDL_ttf.h"

bool TTF_GetTextColorFloat(TTF_Text *text, float *r, float *g, float *b, float *a);

πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • text β€” the TTF_Text to query. the main character, literally. πŸ‘‘
  • r β€” a pointer that gets filled in with the red color value, normally in the range of 0-1, and it may be NULL. πŸ™ˆ
  • g β€” a pointer that gets filled in with the green color value, normally in the range of 0-1, and it may be NULL. 🌿
  • b β€” a pointer that gets filled in with the blue color value, normally in the range of 0-1, and it may be NULL. πŸ’™
  • a β€” a pointer that gets filled in with the alpha value in the range of 0-1, and it may be NULL. πŸ’…

πŸ’€ RETURN VALUE πŸ’€

returns true on success or false on failure β€” and if it fails, bestie, call SDL_GetError() for more information. the error message is giving what you need to know, fr fr.


🧡 THREAD SAFETY 🧡

this function should be called on the thread that created the text. no wandering off to another thread, she's loyal like that. 😭


⭐ AVAILABILITY ⭐

this function is available since SDL_ttf 3.0.0. been iconic for a minute.


🌈 SEE ALSO 🌈


and that's the whole page, periodt. πŸ’œ brought to you by SDL_ttf, version SDL_ttf 3.2.2 β€” no date on this one so we're just gonna vibe with the version, mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from