al_color_xyy(3alleg5)

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

πŸ’– al_color_xyy β€” Allegro 5 API πŸ’–

okay bestie, so this page is al_color_xyy(3alleg5) from the Allegro reference manual, and it's genuinely so cute. sit down, grab a boba, let's talk color spaces πŸŽ€


✨ NAME ✨

al_color_xyy β€” the Allegro 5 API function that hands you a color straight out of the xyY color space. iykyk πŸ’…


🌸 SYNOPSIS 🌸

#include <allegro5/allegro_color.h>

ALLEGRO_COLOR al_color_xyy(float x, float y, float y2)

like, three floats go in, one ALLEGRO_COLOR comes out. no cap. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically this function returns an ALLEGRO_COLOR(3alleg5) structure built from xyY values. that's it, that's the whole vibe 🫢

the tea on the Y component though: in the xyY color space, Y is literally the exact same Y you'd find in XYZ. same girl, different font. πŸ‘‘

but the x and y values? those are computed from XYZ like this, and you're gonna want to screenshot this fr fr:

x = X / (X + Y + Z)
y = Y / (X + Y + Z)

so x and y are just the XYZ components normalized by their sum, periodt. that's the whole math. iconic behavior honestly 🌈

lowkey important: the third parameter in the signature is named y2, not y β€” that's not a typo, that's just how it's written, so don't come for it πŸ’€

⭐ SINCE ⭐

available since version 5.2.3 β€” a classic, a legend, a main character 🌟


πŸ’œ SEE ALSO πŸ’œ


that's the whole page, bestie, you ate it up πŸ“ this was brought to you by the Allegro reference manual, home of al_color_xyy(3alleg5) β€” no dates on this one, just vibes βœ¨πŸ’–πŸ¦‹

πŸ“¦ where this page comes from