al_color_distance_ciede2000(3alleg5)
β¨ NAME β¨
okay so this is the tea on al_color_distance_ciede2000 β it's part of the Allegro 5 API π (yes bestie, the whole manpage is al_color_distance_ciede2000(3alleg5), we been knew)
π SYNOPSIS π
#include <allegro5/allegro_color.h>
double al_color_distance_ciede2000(ALLEGRO_COLOR color1,
ALLEGRO_COLOR color2) {
π DESCRIPTION π
so this function?? it literally computes the CIEDE2000 color difference between two RGB colors π₯ and the whole point is that it's a visually uniform color difference β which is not what you get from, like, the RGB distance. not even close, no cap.
here's the situation with the RGB distance (that's the Euklidean distance between two RGB triplets, fyi): you can have color pairs that have the exact same distance, but the colors in one pair look almost identical to each other, while the colors in the other pair look completely different π like how is that fair. that's the flaw. and it gets improved by using the L*a*b* color space, which was designed with perceptual uniformity in mind in the first place π§ but bestie. it still isn't completely uniform. so the CIEDE2000 formula throws in some extra transformations to fix that. slay.
the returned color distance is roughly in the range 0 (identical color) to 1 (completely different color) β but values greater than one are possible π so don't come for it when it goes over.
Note: This function usesal_color_lab(3alleg5)internally which defines the L component to be in the range0..1(and not0..100as is sometimes seen). π so if you were expecting0..100... that's a you problem, it's0..1here.
β SINCE β
5.2.3 β she's been iconic since 5.2.3, periodt π
Allegro reference manual πΈ and that's the al_color_distance_ciede2000(3alleg5) page, mwah, love u, go measure some color distances bestie πβ¨ππ¦
π¦ 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