[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: function to get inverse color name?
From: |
Drew Adams |
Subject: |
RE: function to get inverse color name? |
Date: |
Thu, 24 Apr 2014 06:44:07 -0700 (PDT) |
> I'm doing a major overhaul of my emacs 24 init.el files. I'm trying to
> convert a lot of faces from dark to light to set up alternate themes. I
> know I can just invert everything with invert-all-faces, but I want to do
> them individually and have the correct name.
>
> Does anyone have a function that takes a named color (e.g. "Red") and
> returns the inverse? I guess it would convert the name to RRGGBB, subtract
> each 8-bit value from 256, and then convert back to a name.
>
> Thanks for any help and/or pointers to useful functions!
Library hexrgb.el has this (`hexrgb-complement') and many other such
utility functions for colors.
Library palette.el provides a WYSIWYG color palette for working with
colors. In the palette, `~' picks the complement of the current color.
Both libraries are on Emacs Wiki and MELPA:
http://www.emacswiki.org/emacs-en/download/hexrgb.el
http://www.emacswiki.org/emacs-en/download/palette.el
You can see the color palette here:
http://www.emacswiki.org/emacs/ColorPalette