Function: tty-color-desc

tty-color-desc is a byte-compiled function defined in tty-colors.el.gz.

Signature

(tty-color-desc COLOR &optional FRAME)

Documentation

Return the description of the color COLOR for a character terminal.

Value is a list of the form (NAME INDEX R G B). The returned NAME or RGB value may not be the same as the argument COLOR, because the latter might need to be approximated if it is not supported directly.

Source Code

;; Defined in /usr/src/emacs/lisp/term/tty-colors.el.gz
(defun tty-color-desc (color &optional frame)
  "Return the description of the color COLOR for a character terminal.
Value is a list of the form (NAME INDEX R G B).  The returned NAME or
RGB value may not be the same as the argument COLOR, because the latter
might need to be approximated if it is not supported directly."
  (and (stringp color)
       (let ((color (tty-color-canonicalize color)))
	  (or (assoc color (tty-color-alist frame))
	      (let ((rgb (tty-color-standard-values color)))
		(and rgb
		     (let ((pixel (tty-color-24bit rgb frame)))
		       (or (and pixel (cons color (cons pixel rgb)))
			   (tty-color-approximate rgb frame)))))))))