emacs-devel
[Top][All Lists]
Advanced

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

Re: color-complement for defface


From: Julien Danjou
Subject: Re: color-complement for defface
Date: Sun, 20 Feb 2011 18:44:04 +0100
User-agent: Gnus/5.110012 (No Gnus v0.12) Emacs/24.0.50 (gnu/linux)

On Mon, Feb 14 2011, Ted Zlatanov wrote:

> TZ> Julien, do you want to propose a patch to the manual?
>
> I'll take an example, at least, and write the rest.

Sorry Ted. I had your mail tagged important, but well…

Here's a very simple example on how to use it:

#+begin_src: emacs-lisp
(defface myface
  (let ((color "red"))
    `((((class color) (background light))
       (:foreground ,color))
      (((class color) (background dark))
        (:foreground ,(apply 'color-rgb->hex (color-complement color))))
      (t nil)))
  "My face.")
#+end_src

Obviously, a new function/macro could be created to automate this use of
color-complement.

-- 
Julien Danjou
❱ http://julien.danjou.info

Attachment: pgp6CLpkk6s2Q.pgp
Description: PGP signature


reply via email to

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