Subject: Re: bug#25525: 25.1.90; add color highlighting to css mode

From: Tom Tromey <[email-masked]>
Date: Wed, 25 Jan 2017 16:34:00 -0700

>>>>> "Tom" == Tom Tromey <[email-masked]> writes:

Tom> It seemed simpler to always set the :foreground, but I can experiment
Tom> with :distant-foreground instead.

I gave this a try.  I think the code in this patch works better than
:distant-foreground.

One case where it is better is the CSS color "purple", aka #800080.

In my theme the foreground color is black.  My patch picks white as the
foreground, but the Emacs chooses not to use a distant-foreground, but
rather keep a black foreground.

You can compare these two cases by evalling:

(progn
  (insert (propertize
	   "hello\n"
	   'font-lock-face '(:background "#800080" :foreground "black"
					 :distant-foreground "white")))
  (insert (propertize
	   "hello\n"
	   'font-lock-face '(:background "#800080" :foreground "white"))))

I find the latter much more readable.

Tom