From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/19601 Path: main.gmane.org!not-for-mail From: Colin Rafferty Newsgroups: gmane.emacs.gnus.general Subject: Re: HTML foreground and background colors being the same... poll time! Date: 03 Dec 1998 09:54:32 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: References: <199812031400.JAA09195@kramer.bp.aventail.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 X-Trace: main.gmane.org 1035157922 12449 80.91.224.250 (20 Oct 2002 23:52:02 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:52:02 +0000 (UTC) Keywords: white,black 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 JAA29233 for ; Thu, 3 Dec 1998 09:58:41 -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 IAA19701; Thu, 3 Dec 1998 08:56: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 08:55:49 -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 IAA16330 for ; Thu, 3 Dec 1998 08:55:37 -0600 (CST) Original-Received: from piinbh1.ms.com (firewall-user@piinbh1.ms.com [199.89.64.71]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id JAA29087 for ; Thu, 3 Dec 1998 09:55:30 -0500 (EST) Original-Received: (from uucp@localhost) by piinbh1.ms.com (8.8.6/fw v1.22) id JAA24521; Thu, 3 Dec 1998 09:55:21 -0500 (EST) Original-Received: from unknown(144.14.8.140) by piinbh1.ms.com via smap (4.1) id xma023662; Thu, 3 Dec 98 09:54:34 -0500 Original-Received: from sag3.morgan.com (sag3.morgan.com [144.14.8.198]) by sas1.morgan.com (8.8.5/hub v1.87) with ESMTP id JAA22416; Thu, 3 Dec 1998 09:54:34 -0500 (EST) Original-Received: (from craffert@localhost) by sag3.morgan.com (8.8.5/client v1.15) id OAA20848; Thu, 3 Dec 1998 14:54:33 GMT Original-To: w3-beta@indiana.edu, ding@gnus.org X-Face: ""xJff%{>hr-{:QXl"Xk2O@@(+F]e{"%EYQiW@mUuvEsL>=mx96j12qW[%m;|:B^n{J8k?Mz[K1_+H;$v,nYx^1o_=4M,L+]FIU~[[`-w~~xsy-BX,?tAF_.8u&0y*@aCv;a}Y'{w@#*@iwAl?oZpvvv X-Y-Zippy: Did I say I was a sardine? Or a bus??? In-Reply-To: "William M. Perry"'s message of "Thu, 3 Dec 1998 09:00:21 -0500" User-Agent: Gnus/5.070062 (Pterodactyl Gnus v0.62) XEmacs/21.0 (Pyrenean-pre8) Precedence: list X-Majordomo: 1.94.jlt7 Original-Lines: 19 Xref: main.gmane.org gmane.emacs.gnus.general:19601 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:19601 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