From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/73997 Path: news.gmane.org!not-for-mail From: Julien Danjou Newsgroups: gmane.emacs.gnus.general Subject: Re: [gnus git] branch master updated: =1= shr.el (shr-tag-div): Added. Date: Wed, 10 Nov 2010 10:54:06 +0100 Message-ID: References: <87pquvldcs.fsf@lifelogs.com> <87oc9yp21w.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1289382879 29193 80.91.229.12 (10 Nov 2010 09:54:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 10 Nov 2010 09:54:39 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M22365@lists.math.uh.edu Wed Nov 10 10:54:35 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PG7Ny-0000bx-Vk for ding-account@gmane.org; Wed, 10 Nov 2010 10:54:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1PG7Nb-0003aL-NC; Wed, 10 Nov 2010 03:54:11 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1PG7NZ-0003a1-F7 for ding@lists.math.uh.edu; Wed, 10 Nov 2010 03:54:09 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PG7NX-0003vm-Qh for ding@lists.math.uh.edu; Wed, 10 Nov 2010 03:54:08 -0600 Original-Received: from coquelicot-s.easter-eggs.com ([213.215.37.94]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1PG7NX-0006pd-00 for ; Wed, 10 Nov 2010 10:54:07 +0100 Original-Received: from cigue.easter-eggs.fr (cigue.easter-eggs.fr [10.0.0.33]) by rose.easter-eggs.fr (Postfix) with ESMTPS id 2932C140D2 for ; Wed, 10 Nov 2010 10:54:05 +0100 (CET) Original-Received: from jdanjou by cigue.easter-eggs.fr with local (Exim 4.72) (envelope-from ) id 1PG7NW-0002dD-J6 for ding@gnus.org; Wed, 10 Nov 2010 10:54:06 +0100 Mail-Followup-To: ding@gnus.org In-Reply-To: (Lars Magne Ingebrigtsen's message of "Tue, 09 Nov 2010 23:47:19 +0100") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:73997 Archived-At: On Tue, Nov 09 2010, Lars Magne Ingebrigtsen wrote: > So I wonder whether it's easy to write a function (or whether someone > already has written) that would take two colours -- in this instance, > "blue" (say #0000ff) and black, and transform the blue into a colour > "light enough" to be read on a black background. (And the opposite with > a white background, of course.) In rainbow-mode[1], I use luminance computing to determine if the background is light or dark. (defun rainbow-color-luminance (red green blue) "Calculate the luminance of color composed of RED, BLUE and GREEN." (floor (+ (* .2126 red) (* .7152 green) (* .0722 blue)) 256)) If it's > 128, you can assume the color is dark. I'm pretty sure there's a easy way to light or dark a color using its HSV representation and increasing/decreasing it's saturation and value. I can dig a bit and come up with some code if you want. :) [1] http://julien.danjou.info/rainbow-mode.html --=20 Julien Danjou // =E1=90=B0 http://julien.danjou.info