GNU Info

Info Node: (elisp)Color Names

(elisp)Color Names


Next: Text Terminal Colors Prev: Window System Selections Up: Frames
Enter node , (file) or (file)node

Color Names
===========

   These functions provide a way to determine which color names are
valid, and what they look like.  In some cases, the value depends on the
"selected frame", as described below; see Note: Input Focus, for the
meaning of the term "selected frame".

 - Function: color-defined-p color &optional frame
     This function reports whether a color name is meaningful.  It
     returns `t' if so; otherwise, `nil'.  The argument FRAME says
     which frame's display to ask about; if FRAME is omitted or `nil',
     the selected frame is used.

     Note that this does not tell you whether the display you are using
     really supports that color.  When using X, you can ask for any
     defined color on any kind of display, and you will get some
     result--typically, the closest it can do.  To determine whether a
     frame can really display a certain color, use `color-supported-p'
     (see below).

     This function used to be called `x-color-defined-p', and that name
     is still supported as an alias.

 - Function: defined-colors &optional frame
     This function returns a list of the color names that are defined
     and supported on frame FRAME (default, the selected frame).

     This function used to be called `x-defined-colors', and that name
     is still supported as an alias.

 - Function: color-supported-p color &optional frame background-p
     This returns `t' if FRAME can really display the color COLOR (or
     at least something close to it).  If FRAME is omitted or `nil',
     the question applies to the selected frame.

     Some terminals support a different set of colors for foreground and
     background.  If BACKGROUND-P is non-`nil', that means you are
     asking whether COLOR can be used as a background; otherwise you
     are asking whether it can be used as a foreground.

     The argument COLOR must be a valid color name.

 - Function: color-gray-p color &optional frame
     This returns `t' if COLOR is a shade of gray, as defined on
     FRAME's display.  If FRAME is omitted or `nil', the question
     applies to the selected frame.  The argument COLOR must be a valid
     color name.

 - Function: color-values color &optional frame
     This function returns a value that describes what COLOR should
     ideally look like.  If COLOR is defined, the value is a list of
     three integers, which give the amount of red, the amount of green,
     and the amount of blue.  Each integer ranges in principle from 0
     to 65535, but in practice no value seems to be above 65280.  This
     kind of three-element list is called an "rgb value".

     If COLOR is not defined, the value is `nil'.

          (color-values "black")
               => (0 0 0)
          (color-values "white")
               => (65280 65280 65280)
          (color-values "red")
               => (65280 0 0)
          (color-values "pink")
               => (65280 49152 51968)
          (color-values "hungry")
               => nil

     The color values are returned for FRAME's display.  If FRAME is
     omitted or `nil', the information is returned for the selected
     frame's display.

     This function used to be called `x-color-values', and that name is
     still supported as an alias.


automatically generated by info2www version 1.2.2.9