al_color_xyz(3alleg5)

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

✨ 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 the 0..1 range. Not a bug, just how it is 😭. If you wanna check whether that happened, hit up al_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