al_color_xyz(3alleg5)
β¨ al_color_xyz β Allegro 5 API β¨
okay bestie, welcome to the Allegro reference manual π pull up a chair, we're doing colour science today and honestly? it's giving iconic.
π NAME
al_color_xyz β literally the Allegro 5 API function that turns XYZ into a colour for you π
π¦ SYNOPSIS
#include <allegro5/allegro_color.h>
ALLEGRO_COLOR al_color_xyz(float x, float y, float z)
π DESCRIPTION
So basically this hands you back an ALLEGRO_COLOR(3alleg5) struct, built from XYZ values. The CIE 1931 XYZ color space is made of three components, each living in the range 0..1 β no cap. πΈ
The way it breaks down:
- the Y component is the luminance (i.e. the brightness vibe)
- the X and Z components are what define the actual color
And whenever RGB shows up in this house, it's always assumed to be in sRGB space. periodt. π
β οΈ Note, and this one matters bestie: The XYZ color space can represent more colors than are actually visible in sRGB, so the conversion may spit out RGB values that fall outside the0..1range. Not a bug, just how it is π. If you wanna check whether that happened, hit upal_is_color_valid(3alleg5)β it'll tell you. π«Ά
β SINCE
5.2.3 β an OG, honestly π
π SEE ALSO
and that's the whole page, bestie!! no notes, 10/10, she ate πβ¨ this was brought to you by the Allegro reference manual β al_color_xyz(3alleg5), mwah ππ¦π
π¦ 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