[Top][All Lists]

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

bug#33799: 27.0.50; set-foreground-color completion shows background col

From: Juri Linkov
Subject: bug#33799: 27.0.50; set-foreground-color completion shows background colors
Date: Wed, 19 Dec 2018 23:34:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>> 1. M-x set-foreground-color RET TAB
>> shows a completion list of colors with different backgrounds, not
>> foregrounds as it would be natural to expect
> Very lightly tested:
>    (mapcar
>     (lambda (color-name)
> -     (let ((foreground (readable-foreground-color color-name))
> -        (color      (copy-sequence color-name)))
> -       (propertize color 'face (list :foreground foreground
> -                                  :background color))))
> +     (let ((readable (readable-foreground-color color-name))
> +        (color (copy-sequence color-name)))
> +       (propertize color 'face
> +                (if foreground
> +                    (list :foreground color)
> +                  (list :foreground readable :background color)))))

I don't know if readable background is needed for set-foreground-color
like readable foreground is used for set-background-color.  I think
your change to not use readable background is more correct because
then the user will see how the selected color will fit with the background.
This helps to select a suitable combination of foreground/background
colors.  The same way maybe readable foreground should be removed
from the completions of set-background-color.  This would allow to see
how the current foreground color will look on different backgrounds
in the completion list.

reply via email to

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