Subject: RE: bug#41544: 26.3; Possible incorrect results from color-distance

From: Drew Adams <[email-masked]>
Date: Sat, 6 Jun 2020 11:15:57 -0700 (PDT)

(Not following this thread; apologies.)

Noticed this in the patch:

+(defun color-dark-p (rgb)
+  "Whether RGB is more readable against white than black.
+RGB is a 3-element list (R G B), each component in the range [0,1]."

Something seems a bit wrong, here.  Dunno whether
it's the predicate name or the doc string (or both).

The predicate name suggests it's about testing a
color (via RGB) to determine whether it's dark or
light.

The doc string suggests it's specifically about
the readability of _foreground_ text that is of
that color - specifically whether it's more
readable against a white than a black background.

Maybe the predicate name should be changed to
indicate (1) that it's about RGB as a foreground
and (2) it's compared (in terms of contrast or
value or whatever) to a white and black background.

Just a suggestion.  Discovery, based on the
predicate name, will mislead as it is now, I think.

I also think the doc string could say just what it
means by "more readable", i.e. what kind of RGB (or
other) test it uses.