X Window System Core Protocol - Colors

Colors

At the protocol level, a color is represented by a 32-bit unsigned integer, called a pixelvalue. The following elements affect the representation of colors:

  1. the color depth
  2. the colormap, which is a table containing red, green, and blue intensity values
  3. the visual type, which specifies how the table is used to represent colors

In the easiest case, the colormap is a table containing a RGB triple in each row. A pixelvalue x represents the color contained in the x-th row of the table. If the client can change the entries in the colormap, this representation is identified by the PseudoColor visual class. The visual class StaticColor is similar, but the client cannot change the entries in the colormap.

There are a total of six possible visual classes, each one identifying a different way for representing an RGB triple with a pixelvalue. PseudoColor and StaticColor are two. Another two are GrayScale and StaticGray, which differ in that they only display shades of grey.

The two remaining visual classes differ from the ones above because they break pixelvalues in three parts and use three separate tables for the red, green, and blue intensity. According to this color representation, a pixelvalue is converted into an RGB triple as follows:

  1. the pixelvalue is seen as a sequence of bits
  2. this sequence is broken in three parts
  3. each of these three chunks of bits is seen as an integer and used as an index to find a value in each of three separate tables

This mechanism requires the colormap to be composed of three separate tables, one for each primary color. The result of the conversion is still a triple of intensity values. The visual classes using this representation are the DirectColor and TrueColor ones, differing on whether the client can change colormaps or not.

These six mechanisms for representing colors with pixelvalues all require some additional parameters to work. These parameters are collected into a visual type, which contains a visual class and other parameters of the representation of colors. Each server has a fixed set of visualtypes, each one associated with a numerical identifier. These identifiers are 32-bit unsigned integers, but are not necessarily different from identifiers of resources or atoms.

When the connection from a client is accepted, the acceptance packet sent by the server contains a sequence of blocks, each one containing information about a single screen. For each screen, the relative block contains a list of other blocks, each one relative to a specific color depth that is supported by the screen. For each supported depth, this list contains a list of visualtypes. As a result, each screen is associated a number of possible depths, and each depth of each screen is associated a number of possible visual types. A given visual type can be used for more screens and for different depths.

For each visual type, the acceptance packet contains both its identifier and the actual parameters it contains (visual class, etc.) The client stores this information, as it cannot request it afterwards. Moreover, clients cannot change or create new visual types. Requests for creation of a new window include the depth and the identifier of the visual type to use for representing colors of this window.

Colormaps are used regardless of whether the hardware controlling the screen (e.g., a graphic card) uses a palette, which is a table that is also used for representing colors. Servers use colormaps even if the hardware is not using a palette. Whenever the hardware uses palettes, only a limited number of colormaps can be installed. In particular, a colormap is installed when the hardware shows colors according to it. A client can request the server to install a colormap. However, this may require the uninstalling of another colormap: the effect is that windows using the uninstalled colormap are not shown with the correct color, an effect dubbed color flashing or technicolor. This problem can be solved using standard colormaps, which are colormaps with a predictable association between pixelvalues and colors. Thanks to this property, standard colormaps can be used by different applications.

The creation of colormaps is regulated by the ICCCM convention. Standard colormaps are regulated by the ICCCM and by the Xlib specification.

A part of the X colour system is the X Color Management System (xcms). This system was introduced with X11R6 Release 5 in 1991. This system consists of several additional features in xlib, found in the Xcms* series of functions. This system defines device independent color schemes which can be converted into device dependent RGB systems. The system consists of the xlib Xcms* functions and as well the X Device Color Characterization Convention (XDCCC) which describes how to convert the various device independent colour systems into device dependent RGB colour systems. This system supports the CIEXYZ, xyY, CIELUV and CIELAB and as well the TekHVC colour systems.,

Read more about this topic:  X Window System Core Protocol

Other articles related to "colors, color":

Pleasant Valley High School (Pennsylvania) - Dress Code
... district has a strict dress code which limits the type, style and colors of clothing and jewelry students may wear ... The main colors are shades of blue, white, gray, and black ... Colors may not be worn mono-chromatically ...
Siamese Fighting Fish - Colors
... Jewel of the Orient" due to their beauty and wide range of colors which are produced through selective breeding ... Wild fish exhibit strong colors only when agitated ... Colors available to the aquarist include red, blue, black, turquoise, orange, yellow, green, bright blue with pink highlights, cream and even true white (the "Opaque" white, not to be ...
Complementary Colors - Color Theory
... In color theory, two colors are called complementary if, when mixed in the proper proportion, they produce a neutral color (grey, white, or black) ... In roughly-perceptual color models, the neutral colors (white, greys, and black) lie along a central axis ... For example, in the HSV color space, complementary colors (as defined in HSV) lie opposite each other on any horizontal cross-section ...

Famous quotes containing the word colors:

    [The Declaration of Independence] meant to set up a standard maxim for free society, which should be familiar to all, and revered by all; constantly looked to, constantly labored for, and even though never perfectly attained, constantly approximated, and thereby constantly spreading and deepening its influence, and augmenting the happiness and value of life to all people of all colors everywhere.
    Abraham Lincoln (1809–1865)

    He hath ribbons of all the colors i’the rainbow.
    William Shakespeare (1564–1616)

    In Haydn’s oratorios, the notes present to the imagination not only motions, as, of the snake, the stag, and the elephant, but colors also; as the green grass.
    Ralph Waldo Emerson (1803–1882)