The
color element serves to set the color of an
active object. This concerns a diffuse color, thus a color reflected from the object surface; the remaining portion of the light spectrum being absorbed by the object. The color element is a numeric variable. The color's format is the same as that of the colors used in graphics applications of the Peter application:
color = red + green*256 + blue*256*256 + (255-alpha)*256*256*256 (Individual color components are integers the values of which range between 0 and 255, and the alpha channel value lies in the range 0=transparency till 255=normal color), therefore it is possible to use the
color constant and the
compound color components to color elements to set the color. The advantage of the "compound color components to color" element consists in enabling to use the full range of color setting (The element is not bound by the Peter application's colors). In addition to that the element facilitates the alpha channel value setting. The alpha channel enables to carry out special
transparency operations, e.g. it enables to change the object transparency continuously (transparency code 54).
By setting the object color to
-1 the internal object color will be used instead of the color specified. Colors for the object's particular vertices or faces can be defined internally, either by the
texture mapping command or by
reading the object in from a file. For the interfaces DirectX 3 through Direct 6 the vertex or face colors are used only when the
object lighting is off.
By setting the object color to
-2 the material inherited from a parent, i.e. from the object to which this object is
connected, will be used instead of the object material (and color) specified. When, in addition, the object does not possess any intrinsic texture, then a texture inherited from the parent will be used, too. Material and texture can be inherited from the scene (object index 0). The default setting is white color without texture.