al_color_html(3alleg5)
π al_color_html β Allegro 5 API π
okay bestie, so this one is literally a whole page from the Allegro reference manual and it's about turning cute little hex color strings into actual colors. we love a glow-up. β¨
β¨ SYNOPSIS β¨
#include <allegro5/allegro_color.h>
ALLEGRO_COLOR al_color_html(char const *string)
π DESCRIPTION π
so what this does is it takes an HTML-style hex number β like #00faff, you know the vibe, very cutesy, very web-1.0 β and it interprets it as a color. that's it. that's the function. π¦
the format it accepts? literally the exact same one that al_color_html_to_rgb(3alleg5) accepts. no cap. if you know that one you already know this one, iykyk. π
and then it gives you back the interpreted color. so fun. so aesthetic. π
but bestie... listen. if the string could not be parsed? it returns al_map_rgba(0, 0, 0, 0). that's fully transparent black, the void, the nothingness, the no color at all. so like, if you get a see-through ghost back, that's why. π
β οΈ Note: the behaviour on invalid strings is different from Allegro 5.0.x. so if you're porting old code and something looks off β this is probably it. not me finding out the hard way π
π SEE ALSO π
al_color_html_to_rgb(3alleg5)β the sibling that goes html β‘οΈ rgbal_color_rgb_to_html(3alleg5)β and this one goes the other way, rgb β‘οΈ html, a full circle moment π
okay that's the whole page, you're literally an expert now, main character energy fr fr πβ¨
this was brought to you by the Allegro reference manual, page al_color_html(3alleg5) β go slay some hex codes bestie, ily π«Άπ
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms