HPlogo Using the X Window System > Chapter 5 Application Resources

Color Resources

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

You can specify color resources in either of two ways:

  • By color name.

    The rgb.txt file in /usr/lib/X11 lists all the named colors. Refer to “Creating a Custom Color Database with `rgb'” for information about how to add colors to this file.

  • By a number specifying the amount of red, green, and blue the color contains.

    The rgb numbers have the syntax:

    #RedGreenBlue

    where Red, Green, and Blue are hexadecimal numbers containing 1, 2, 3, or 4 digits for each primary color indicating the amount of that color used. There must be the same number of digits for each of the primary colors. Thus, valid color values consist of 3, 6, 9, or 12 hexadecimal digits.

For example, white can be specified by any of these rgb values: #fff, #ffffff, #fffffffff, or #ffffffffffff. Red can be specified by #f00, #ff0000, #fff000000, or #ffff00000000.

The following line specifies the background color of hpterm icons by color name:

   Mwm*hpterm*iconImageBackground:   DarkSlateGrey

The same color could be specified by rgb value:

   Mwm*hpterm*iconImageBackground:   #2f2f4f4f4f4f

Refer to the man page for a specific client to see if there are special elements for that client that can be colored. For example, xclock allows you to color the hands and tic marks in addition to the background, foreground, and window frame colors.

© 1995 Hewlett-Packard Development Company, L.P.