Function: color-values

color-values is a byte-compiled function defined in faces.el.gz.

Signature

(color-values COLOR &optional FRAME)

Documentation

Return a description of the color named COLOR on frame FRAME.

COLOR should be a string naming a color (e.g. "white"), or a string specifying a color's RGB components (e.g. "#ff12ec").

Return a list of three integers, (RED GREEN BLUE), each between 0 and 65535 inclusive. Use color-name-to-rgb if you want RGB floating-point values normalized to 1.0.

If FRAME is omitted or nil, use the selected frame. If FRAME cannot display COLOR, the value is nil.

COLOR can also be the symbol unspecified or one of the strings
"unspecified-fg" or "unspecified-bg", in which case the
return value is nil.

View in manual

Probably introduced at or before Emacs version 21.1.

Aliases

x-color-values (obsolete since 30.1) ps-color-values (obsolete since 28.1)

Source Code

;; Defined in /usr/src/emacs/lisp/faces.el.gz
(defun color-values (color &optional frame)
  "Return a description of the color named COLOR on frame FRAME.
COLOR should be a string naming a color (e.g. \"white\"), or a
string specifying a color's RGB components (e.g. \"#ff12ec\").

Return a list of three integers, (RED GREEN BLUE), each between 0
and 65535 inclusive.
Use `color-name-to-rgb' if you want RGB floating-point values
normalized to 1.0.

If FRAME is omitted or nil, use the selected frame.
If FRAME cannot display COLOR, the value is nil.

COLOR can also be the symbol `unspecified' or one of the strings
\"unspecified-fg\" or \"unspecified-bg\", in which case the
return value is nil."
  (cond
   ((member color '(unspecified "unspecified-fg" "unspecified-bg"))
    nil)
   ((display-graphic-p frame)
    (xw-color-values color frame))
   (t
    (tty-color-values color frame))))