al_color_distance_ciede2000(3alleg5)

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

✨ 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 uses al_color_lab(3alleg5) internally which defines the L component to be in the range 0..1 (and not 0..100 as is sometimes seen). πŸ™ˆ so if you were expecting 0..100... that's a you problem, it's 0..1 here.

⭐ 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