on the screen) When the window is made visible and its content has to be drawn, the server sends the client an Expose event In response to this event, the client requests a box to be drawn by sending a PolyFillRectangle request with window 0x00200001 and graphic context 0x00200000 If the window is covered by another window and uncovered again, assuming that backing store is not maintained: The server sends another Expose event to tell the client that the window has to be drawn again The client redraws the window by sending a PolyFillRectangle request If a key is pressed: The server sends a KeyPress event to the client to notify it that the user has pressed a key The client reacts appropriately (in this case, it terminates) 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: the color depth the colormap, which is a table containing red, green, and blue intensity values 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: the pixelvalue is seen as a sequence of bits this sequence is broken in three parts 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