--------------------X PIXMAP (.xpm) IMAGE FORMAT, VERSION 3---------------------
--------------------------------------------------------------------------------
An X PixMap image is stored as a fragment of C source code in which the first
line is "/* XPM */" and the remaining lines define an array of ``static char*''
(usually with a name identical to that of the file with '_' in place of '.').
This array contains the following strings, in order:
- a string containing four or six decimal integers, separated by whitespace,
which, in order, specify the width of the image in pixels (hereafter called
$width), the height of the image in pixels (hereafter called $height), the
number of colors used in the image (hereafter called $colors), the number of
characters used to represent each color (hereafter called $cpp), and,
optionally, the x- and y-coordinates of the image's "hotspot" (for using the
image as a mouse cursor). The string may also optionally end with the
substring "XPMEXT" (separated from preceding integers by whitespace), which
indicates that the image uses extensions.
- "$colors" strings, specifying the colors used in the image. Each string
consists of the following items separated by whitespace:
- "$cpp" characters (immediately at the beginning of the string) which will
be used to represent a pixel in the image data
- one or more pairs of keys & color values describing what color(s) to use
for the associated pixel(s)
- A key is one of:
- "c" - indicates that the corresponding color should be used when the image
is displayed in a color visual
- "m" - indicates that the corresponding color should be used when the image
is displayed in a monochrome visual
- "g4" - indicates that the corresponding color should be used when the
image is displayed in a 4-color/4-level greyscale visual
- "g" - indicates that the corresponding color should be used when the image
is displayed in a greyscale visual with more than four colors/levels
- "s" - indicates that the corresponding color is a symbolic name describing
a color that can be overridden at load time (e.g., "light_color",
"lines_in_mix", "lines_in_dark", "dark_color", etc.)
- A color value is one of:
- a color name (corresponding to an entry in an X11 color names file)
- a '#' followed by a hexadecimal RGB code
- a '%' followed by an HSV code
- the string "None", indicating a transparent or otherwise omitted pixel
- Keys are separated from color values by whitespace.
- "$height" strings (corresponding to the rows of the image from top to
bottom) of length "$width * $cpp" in which each consecutive substring of
length "$cpp" describes a pixel of the image (from left to right) as having
the color(s) defined for that substring by the preceding section
- If & only if the "XPMEXT" flag is present:
- one or more extension subsections, which take two possible forms:
- a string containing, in order, "XPMEXT", whitespace, the name of the
extension, whitespace, and the extension data
- a string containing, in order, "XPMEXT", whitespace, and the name of the
extension, followed by one or more strings of extension data
- the string "XPMENDEXT"