PseudoColor has a read-write colormap that clients can fill by their color requests. PseudoColor has the possibility of allocation failure. TrueColor has well defined colormap entries according to the bits defined by its visual. The client must manipulate these bits to obtain the pixel with the color they require. DirectColor is like TrueColor , but with an initially undefined colormap.
Clients allocate colors as needed, using the bits specified by the visual to calculate pixel values.
DirectColor has the possibility of allocation failure, and is generally the most difficult of all the visuals to correctly use. First, if a standard colormap property exists, we would like to use it. If the visualid of the standard colormap matches the id of our client's visual, we can use the previous calculation to get our pixel value, and all is well. StaticGray and GrayScale colormaps, except for one being uninitialzed, could be treated the same. If we could somehow order the entries in both types of colormap, we could mathematically calculate pixel values.