Gnus development mailing list
 help / color / mirror / Atom feed
From: Ken McGlothlen <mcglk@serv.net>
Cc: w3-beta@indiana.edu, ding@gnus.org
Subject: Re: HTML foreground and background colors being the same... poll time!
Date: Thu, 3 Dec 1998 08:08:36 -0800 (PST)	[thread overview]
Message-ID: <199812031608.IAA09134@ralf.serv.net> (raw)
In-Reply-To: <vgvyaop6ztj.fsf@ms.com>

colin@xemacs.org (Colin Rafferty) writes:

| William M Perry writes:
| 
| > 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?
| 
| I vote for (c), but I know that finding contrasting colors is hard to
| do.  However, since all you need is a single constrasting color, you
| could choose between black and white.
| 
| ;; Take the "average" level, and go opposite
| 
| (defun infer-contrasting-color (r g b)
|   (if (and (<= r 255)
| 	   (<= g 255)
| 	   (<= b 255))
|       (if (< (+ r g b) 384) "white" "black")   ; (/ (* 256 3) 2) => 384
|     (if (< (+ r g b) 98304) "white" "black"))) ; (/ (* 65536 3) 2) =>  => 382
| 
| ;; Colin

This is actually a slight improvement to the one I was going to suggest; I
guess I've been doing web stuff for so long, I forgot about 16-bit color.  :)

This is perhaps slightly less boring than the complement one, but does produce
readable results in all cases, even the annoyingly borderline ones, and it's
the one I'd support.

Of course, a gnus-select-perfect-colors-based-on-subject-matter function might
be better, but might make the package run a bit slow.  :)


  reply	other threads:[~1998-12-03 16:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-03 14:00 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199812031608.IAA09134@ralf.serv.net \
    --to=mcglk@serv.net \
    --cc=ding@gnus.org \
    --cc=w3-beta@indiana.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).