help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fontify: coloring rgb hex code by its value


From: Xah
Subject: Re: Fontify: coloring rgb hex code by its value
Date: Fri, 2 May 2008 22:52:13 -0700 (PDT)
User-agent: G2/1.0

Thanks all. Very helpful.

 Xah

On Apr 25, 8:35 am, "Drew Adams" <drew.ad...@oracle.com> 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 be 
> 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)
>   (let ((rgb-string (orhex-rgb (hexrgb-color-name-to-hexcolor-name))))
>     (put-text-property 0 (length rgb-string) 'face
>                        (cons 'background-colorrgb-string)
>                        rgb-string)
>     (list (listcolor-name rgb-string))))
>
> That is in icicles-cmd.el:http://www.emacswiki.org/cgi-bin/wiki/icicles-cmd.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.emacswiki.org/cgi-bin/wiki/palette.el



reply via email to

[Prev in Thread] Current Thread [Next in Thread]