bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#30295: CSS mode colour highlighting makes text hard to read


From: Richard Copley
Subject: bug#30295: CSS mode colour highlighting makes text hard to read
Date: Thu, 1 Feb 2018 23:03:16 +0000

On 1 February 2018 at 21:17, Juri Linkov <address@hidden> wrote:

>> If the color-distance is to be used, the appropriate formula is:
>>
>> (if (> (color-distance name "black") (color-distance name "white"))
>> "black" "white")
[...]
>> For what it's worth, in my inexpert opinion it makes more sense to
>> compare the luma against that of mid-grey as Tom originally proposed.
>
> Indeed, luma is more suitable than mid-grey, customizing
> ‘list-colors-sort’ to “luminance” shows that distinguishable colors with
> the black foreground start closer to the beginning of the color list.

I think you and I are in agreement, but to clarify (just in case), the
two options I was talking about were:

1: Choose black if the colour is closer to white than black, in the
color-distance metric (like the Lisp expression I wrote).

2 (better): Choose black if the colour's luma is greater than the luma
of mid-grey, where by mid-grey I meant "#808080", and where I don't
particularly mind what "luma" means.

Eli also mentioned the idea of using the complementary colour (see
#25525) but that can look quite unpleasant due to chromostereopsis,
depending on the surrounding colours. Colour-blind people might also
find it difficult (I'm not sure).

> Or we could use both luma and distance like in ‘shr-color-visible’
> with two customizable options:
> ‘shr-color-visible-luminance-min’ and
> ‘shr-color-visible-distance-min’.

Thanks, a trove of useful functions are in "shr-color.el" and
"color.el". Using color-rgb-to-hsl and extracting the luminance would
make for readable code for option 2.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]