al_color_lch(3alleg5)
๐ NAME ๐
al_color_lch โ it's giving Allegro 5 API, bestie โจ
๐ SYNOPSIS ๐
#include <allegro5/allegro_color.h>
ALLEGRO_COLOR al_color_lch(float l, float c, float h)
๐ DESCRIPTION ๐
Okay so this one hands you back an ALLEGRO_COLOR(3alleg5) struct, built from CIE LCH values. Slay ๐
LCH colors are lowkey super similar to HSL โ same meaning for L and H, and C does the job that S does. But here's the tea: LCH is way more visually uniform. Like, the gradients actually look even. Iconic behavior fr fr.
โ ๏ธ And heads up bestie, this is the part that gets people: this function wants the angle for H in radians, not degrees. Not me accidentally passing degrees and getting a whole different vibe ๐ญ
So the CIE LCH color space? It's a cylindrical representation of the L*a*b* color space. The L component stays exactly the same, and C and H get computed like this:
C = sqrt(a * a + b * b)
H = atan2(b, a)
Math ate that, no cap ๐งฎโจ
๐ฆ SINCE ๐ฆ
5.2.3 โ she's been here a minute, and she's still serving ๐
๐ธ SEE ALSO ๐ธ
And that's the whole page, babe โ straight out of the Allegro reference manual, page al_color_lch(3alleg5). Go convert some colors, you've got this ๐๐
๐ฆ 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