GNU Emacs Lisp Reference Manual
t if so; otherwise, nil.
Note that this does not tell you whether the display you are using really supports that color. You can ask for any defined color on any kind of display, and you will get some result---that is how the X server works. Here's an approximate way to test whether your display supports the color color:
(defun x-color-supported-p (color)
(and (x-color-defined-p color)
(or (x-display-color-p)
(member color '("black" "white"))
(and (> (x-display-planes) 1)
(equal color "gray")))))
nil.
(x-color-values "black")
=> (0 0 0)
(x-color-values "white")
=> (65280 65280 65280)
(x-color-values "red")
=> (65280 0 0)
(x-color-values "pink")
=> (65280 49152 51968)
(x-color-values "hungry")
=> nil