From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/19609 Path: main.gmane.org!not-for-mail From: Ken McGlothlen Newsgroups: gmane.emacs.gnus.general Subject: Re: HTML foreground and background colors being the same... poll time! Date: Thu, 3 Dec 1998 08:08:36 -0800 (PST) Sender: owner-ding@hpc.uh.edu Message-ID: <199812031608.IAA09134@ralf.serv.net> References: <199812031400.JAA09195@kramer.bp.aventail.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035157928 12486 80.91.224.250 (20 Oct 2002 23:52:08 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:52:08 +0000 (UTC) Cc: w3-beta@indiana.edu, ding@gnus.org Return-Path: Original-Received: from gizmo.hpc.uh.edu (gizmo.hpc.uh.edu [129.7.102.31]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id LAA01085 for ; Thu, 3 Dec 1998 11:10:55 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@sina.hpc.uh.edu [129.7.3.5]) by gizmo.hpc.uh.edu (8.9.1/8.9.1) with ESMTP id KAA19926; Thu, 3 Dec 1998 10:09:15 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 03 Dec 1998 10:09:15 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id KAA17261 for ; Thu, 3 Dec 1998 10:09:07 -0600 (CST) Original-Received: from ralf.serv.net (ralf.serv.net [205.153.153.77]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id LAA01069 for ; Thu, 3 Dec 1998 11:08:58 -0500 (EST) Original-Received: (from mcglk@localhost) by ralf.serv.net (8.8.5/8.8.5) id IAA09134; Thu, 3 Dec 1998 08:08:36 -0800 (PST) Original-To: Colin Rafferty X-Mailer: VM 6.33 under Emacs 19.34.1 Precedence: list X-Majordomo: 1.94.jlt7 Original-Lines: 31 Xref: main.gmane.org gmane.emacs.gnus.general:19609 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:19609 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. :)