al_is_color_valid(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ al_is_color_valid πŸ’–

okay so bestie, we're in the Allegro 5 API and this lil function is your vibe check for colors 🎨✨ it lives in the 3alleg5 manual, and it's about to be your fave.


🌸 SYNOPSIS 🌸

#include <allegro5/allegro_color.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does it even do? it checks if all components of the color are between 0 and 1. that's it. that's the whole job. iconic behavior honestly πŸ’…

but wait, why would you even need this?? okay so some of the color conversions in this addon support color spaces with more colors than can be represented in sRGB, and when you convert those bad boys to RGB you get invalid color components outside the 0..1 range 😭 like the math just does not math for sRGB. so yeah, this function is the one going "bestie... that's not a valid color" 🫢

no cap, if you're converting from a fancy wide-gamut space, run this check before you trust those numbers fr fr.

⭐ SINCE ⭐

5.2.3 β€” so it's been serving since way back, lowkey a legend πŸ‘‘


and that's the whole page, we ate and left no crumbs πŸ“πŸ’œ

Allegro reference manual β€” page al_is_color_valid(3alleg5). k bye, love u, go validate some colors πŸŒˆπŸŽ€

πŸ“¦ where this page comes from