rgb Command

Purpose

Creates the database used by the X-Window system server for colors.

Syntax

rgbDatabaseName ] [  <InputfileName  ]

Description

The rgb command reads lines from standard input and inserts them into its database to associate color names with specific red, green, and blue (RGB) values.

The rgb command produces two output files: DatabaseName.dir and DatabaseName.pag. If you do not specify a database file name, the default names rgb.dir and rgb.pag are used.

Each color entry is in the form:

Red Green Blue Colorname

where the Red, Green, and Blue elements are integer values ranging from 0-255. The actual color is determined by how the elements are combined. Each element can range from no intensity (0) to full intensity (255). The Colorname parameter can be descriptive or fanciful. For example, the sequence 250 250 250 could be named white or snow. Two or more entries can share the same element numbers or names.

Parameters

Item Description
DatabaseName Specifies the database to create for the output data.
<InputFileName Specifies the name of the input file.

Examples

  1. The following example shows a portion of an input file:
    248 248 255      ghost white
    245 245 245      white smoke
    255 250 240      floral white
    253 245 230      old lace
    250 240 230      linen
    255 218 185      peach puff
    255 248 220      cornsilk
    255 250 205      lemon chiffon
    245 255 250      mint cream
    240 255 255      azure
  2. The following example generates the output files Newcolor.dir and Newcolor.pag.
    rgb Newcolor < rgb.txt
    where Newcolor is the DatabaseName and rgb.txt is the InputFileName.

Files

Item Description
/usr/lib/X11/rgb.txt The default rgb database input file.