Subject: Re: bug#15977: 24.3.50; enhancement request: `sample' for Customize colors should show fg & bg

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 26 Jan 2022 18:08:15 +0100

Lars Ingebrigtsen <[email-masked]> writes:

> Thanks for the recipe.  Yes, I agree with you -- it would be better if
> it also showed this colour as a background (i.e., block), which would
> make it easier to determine whether to use the colour.  And like Juri
> says, it should probably be two samples, one as a foreground and one as
> a background.

I had a peek at this, and the sample faces come from here:

(define-widget 'color 'editable-field
  "Choose a color name (with sample)."
  :format "%{%t%}: %v (%{sample%})\n"
  :value-create 'widget-color-value-create
  :size (1+ (apply #'max 13 ; Longest RGB hex string.
                   (mapcar #'length (defined-colors))))
  :tag "Color"
  :value "black"
  :completions (defined-colors)
  :sample-face-get 'widget-color-sample-face-get

But of course, you can't have two samples in the :format, I think?
So...  you'd have to create...  er...  a sub widget?  OK, I give up.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no