From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: Re: Fontify: coloring rgb hex code by its value Date: Fri, 2 May 2008 22:52:13 -0700 (PDT) Organization: http://groups.google.com Message-ID: <26092eed-3f0a-451d-9b31-2c2aa64278e8@j33g2000pri.googlegroups.com> References: <06adf465-6005-4b23-8d0e-1ba9411c7089@m1g2000pre.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1209796851 29367 80.91.229.12 (3 May 2008 06:40:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 May 2008 06:40:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 03 08:41:25 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JsBQy-0003Pm-TH for geh-help-gnu-emacs@m.gmane.org; Sat, 03 May 2008 08:41:25 +0200 Original-Received: from localhost ([127.0.0.1]:35617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JsBQH-0001va-If for geh-help-gnu-emacs@m.gmane.org; Sat, 03 May 2008 02:40:41 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!j33g2000pri.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: 24.6.97.120 Original-X-Trace: posting.google.com 1209793933 30224 127.0.0.1 (3 May 2008 05:52:13 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 3 May 2008 05:52:13 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j33g2000pri.googlegroups.com; posting-host=24.6.97.120; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.1 Safari/525.18, gzip(gfe), gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:158366 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:53734 Archived-At: Thanks all. Very helpful. Xah On Apr 25, 8:35=A0am, "Drew Adams" wrote: > > i seems to recall that there's a module that will fontify ahexcolor > > code by its value. > > That is, if i have this line in my .css file: > > pre.php {border-color:#2e8b57} > > then the "#2e8b57" is colored using that value. > > anyone know what's the name of this module or where can i get it? > > A short code showing can this can be written will also be appreciated. > > I believe this is done in the code for `list-colors-display'. That could b= e one > place to start. I do the same thing in some of my code, for example this: > > (defun icicle-make-color-candidate (color-name &optionalhex-rgb) > =A0 (let ((rgb-string (orhex-rgb (hexrgb-color-name-to-hexcolor-name)))) > =A0 =A0 (put-text-property 0 (length rgb-string) 'face > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(cons 'background-colorrgb-= string) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rgb-string) > =A0 =A0 (list (listcolor-name rgb-string)))) > > That is in icicles-cmd.el:http://www.emacswiki.org/cgi-bin/wiki/icicles-cm= d.el > > It uses code in hexrgb.el:http://www.emacswiki.org/cgi-bin/wiki/hexrgb.el > > See also command `palette' of palette.el, for similar code:http://www.emac= swiki.org/cgi-bin/wiki/palette.el