Discussion:
color selector envy
(too old to reply)
John S. Yates, Jr.
2005-09-28 03:25:18 UTC
Permalink
I am in the throws of attempting to develop a satisfying
(non-garish, non-jarring) black background color scheme.
This is proving to be a more difficult undertaking than I
would have expected. list-colors-display colors that are
most often either too dark to be easily readable or too
light to be easily distinguished. I really want an RGB
or better yet an HSV widget that will let me incrementally
visualize what a face will look like in context.

I have googled and searched the emacs wiki to no avail.
Drew Adam's seems to have written a number of useful
building blocks as part of his DoReMi effort but so far I
have not found anything to match this beautiful vim widget:

http://www.vim.org/scripts/script.php?script_id=927
Loading Image...

Have I missed anything useful?

/john
Chris McMahan
2005-09-28 12:13:01 UTC
Permalink
John,

While this won't provide an easy way to incrementally change the
colors, this function might prove helpful. I can't claim credit for it,
but I have found it useful when defining color themes.

Also, have you taken a look at the color-themes package? There are a
lot of pre-configured themes that you can use, and it makes it quite
simple to modify existing or create your own.
Post by John S. Yates, Jr.
I am in the throws of attempting to develop a satisfying
(non-garish, non-jarring) black background color scheme.
This is proving to be a more difficult undertaking than I
would have expected. list-colors-display colors that are
most often either too dark to be easily readable or too
light to be easily distinguished. I really want an RGB
or better yet an HSV widget that will let me incrementally
visualize what a face will look like in context.
I have googled and searched the emacs wiki to no avail.
Drew Adam's seems to have written a number of useful
building blocks as part of his DoReMi effort but so far I
http://www.vim.org/scripts/script.php?script_id=927
http://trific.ath.cx/Img/screenshots/gvim-colorsel.png
Have I missed anything useful?
/john
;;;======================================================================
;;; Subject: CODE: List faces with r g b values of foreground and background color
;;; From: ***@yahoo.com (Sandip Chitale)
;;; Newsgroups: gnu.emacs.sources
;;; Date: 21 Oct 2003 00:23:04 -0700
;;;======================================================================
(defun face-colors-rgb ()
"List face, foreground color, foreground r g b, background color and background r g b."
(interactive)
(set-buffer (get-buffer-create "*faces colors rgb*"))
(setq truncate-lines t)
(toggle-read-only -1)
(let ((f)
(c)
(rgb))
(insert (format "%-35.35s %-15.15s %s %-15.15s %s\n"
"Face"
"Foreground "
" R G B "
"Background "
" R G B "))
(insert (format "%-35.35s %-15.15s %s %-15.15s %s\n"
"-----------------------------------"
"--------------"
"--------------"
"--------------"
"--------------"))
(dotimes (idx (length (face-list)))
(setq f (nth (1- idx) (face-list)))
(insert (propertize (format "%-35.35s" f ) 'face f))
(setq fg (face-attribute f :foreground))
(setq bg (face-attribute f :background))
(setq rgb (color-values fg))
(setq r "-")
(setq g "-")
(setq b "-")
(if rgb
(progn (setq r (/ (nth 0 rgb) 256))
(setq g (/ (nth 1 rgb) 256))
(setq b (/ (nth 2 rgb) 256)))
)
(insert (format " %-15.15s [%03.3s %03.3s %03.3s] " fg r g b))
(setq rgb (color-values bg))
(setq r "-")
(setq g "-")
(setq b "-")
(if rgb
(progn (setq r (/ (nth 0 rgb) 256))
(setq g (/ (nth 1 rgb) 256))
(setq b (/ (nth 2 rgb) 256)))
)
(insert (format " %-15.15s [%03.3s %03.3s %03.3s]" bg r g b))
(insert "\n")))
(switch-to-buffer "*faces colors rgb*")
(delete-trailing-whitespace)
(toggle-read-only 1)
(goto-char (point-min)))
--
(. .)
=ooO=(_)=Ooo=====================================
Chris McMahan | ***@one.dot.net
=================================================
Continue reading on narkive:
Loading...