al_color_lab(3)

๐Ÿ“ฆ
version 5.2.11.3 ยท 3 versions
, in arch rolling

๐ŸŽ€ NAME ๐ŸŽ€

okay bestie, this is al_color_lab(3) from the Library Functions Manual โ€” it's part of the Allegro 5 API, and it's literally the function for turning CIE L*a*b* values into an ALLEGRO_COLOR(3). slay.

โœจ SYNOPSIS โœจ

#include <allegro5/allegro_color.h>

ALLEGRO_COLOR al_color_lab(float l, float a, float b)

๐ŸŒธ DESCRIPTION ๐ŸŒธ

So here's the tea: al_color_lab returns an ALLEGRO_COLOR(3) structure from CIE L*a*b* values. The L* component corresponds to luminance from 0..1, babe. The a* and b* components are in the range -1..+1. periodt.

Note: The L*a*b* color space can represent more colors than are visible in sRGB, so conversion may result in RGB values outside of the 0..1 range. You can check for that case with al_is_color_valid(3). not me warning you ahead of time ๐Ÿ’…
Note: In some literature the range of L* is 0 to 100 and a* and b* are from -100 to +100. In that case divide all components by 100 before passing them to this function. math girlies, this one's for you ๐Ÿงฎโœจ

โญ SINCE โญ

5.2.3 โ€” yes, it's been iconic since 5.2.3, no cap.

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹


๐Ÿ’– and that's the whole page, bestie โ€” from the Allegro reference manual, page al_color_lab(3), and the footer had no date so I'm not inventing one ๐Ÿ’€ cute sign-off complete ๐Ÿซถ

๐Ÿ“ฆ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 ยท Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms