Gnus development mailing list
 help / color / mirror / Atom feed
* HTML foreground and background colors being the same... poll time!
@ 1998-12-03 14:00 William M. Perry
  1998-12-03 14:26 ` Hrvoje Niksic
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: William M. Perry @ 1998-12-03 14:00 UTC (permalink / raw)


Ok, so what should Emacs/W3 do if someone happens to lose so badly as to
specify a background or foreground color without also specifying the other?

We could:

a) Do nothing (current practice)
b) Infer the missing color by taking rgb(~r,~g,~b) 
c) Infer the color some other way?

a is ugly and bad and should change, I think we would all agree.

b is pretty easy to implement:

(defun infer-contrasting-color (r g b)
  (if (and (<= r 255)
	   (<= g 255)
	   (<= b 255))
      (format "#%02x%02x%02x"
	      (logxor r 255)
	      (logxor g 255)
	      (logxor b 255)))
  (format "#%04x%04x%04x"
	  (logxor r 65535)
	  (logxor g 65535)
	  (logxor b 65535)))


but for things like a pure red background it ends up giving you aquamarine, 
which is kind of eye searing.

I'd vote for (c), but I have no clue on how to go about finding or writing
a good contrast-finding algorithm.  Anyone out there know of one?

-Bill P.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~1998-12-09 16:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-03 14:00 HTML foreground and background colors being the same... poll time! William M. Perry
1998-12-03 14:26 ` Hrvoje Niksic
1998-12-03 14:37   ` Didier Verna
1998-12-03 14:44     ` Hrvoje Niksic
1998-12-03 14:54 ` Colin Rafferty
1998-12-03 16:08   ` Ken McGlothlen
1998-12-03 14:56 ` Bill White
1998-12-03 16:43 ` Wes Hardaker
1998-12-03 18:49 ` Matt Armstrong
1998-12-09 16:06   ` William M. Perry
1998-12-04  1:19 ` Laurent Martelli
1998-12-04  5:31   ` Felix Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).