Department of Mathematics - University of Utah Home • Computing • Course Schedules • CSME • Current Positions • FAQ (Computing) • Forms • Graduate • High School • Lecture Videos • Mailbox Access • Math Biology • Math Education • Newsletter • People • Research • RTG Grants • Seminars •

# Color FAQ

Last update: Thu Mar 23 12:36:03 2017

1. How can I print in color?
2. How do I list workstation colors by name?
3. How can I pick colors visually?
4. I picked a nice color for my screen, but found that it looks different on other displays and on printers. Why?
5. How do I use color in LaTeX?
6. Are there guidelines for design with color?

1.   How can I print in color?

All of our color printers have queue names that end in color. You can find their names like this:

% lpstat -t | grep color
...
printer jwb239color is idle.  enabled since Jan 01 00:00
printer lcb126color is idle.  enabled since Jan 01 00:00
printer lcb331color is idle.  enabled since Jan 01 00:00
...


Use a suitable queue name in a print command:

% lpr -Pjwb239color myfile.ps
% lp -d jwb239color myfile.ps


For more on these commands, see the printing FAQ.

Our fastest, cheapest, and by-far-the-best-quality-output color printer is the Xerox 3535 in JWB 239. Its output for continuous-tone images is close to photographic quality, and the best quality is obtained when special color-printing paper is loaded, instead of the usual low-cost copier paper.

Except on the Xerox 3535, color printing is relatively expensive: about 10 times the cost of black-and-white printing, and with inkjet printers, sometimes much more. Consequently, please be economical in your use of color printing.

2.   How do I list workstation colors by name?

Use the showrgb utility:

% showrgb | wc -l
752

% showrgb | grep gold
139 105  20             goldenrod4
...
205 173   0             gold3
255 215   0             gold1
...
238 232 170             palegoldenrod


There are hundreds of named colors to choose from, and showrgb finds them in a file called rgb.txt, stored in different locations on different flavors of Unix (e.g., /usr/X11R6/lib/X11 on BSD, GNU/Linux, and Mac OS X systems, /usr/lib/X11 on IRIX and OSF/1, and /usr/openwin/lib on Solaris).

Each color is defined by a triple of red, green, and blue intensities in the range [0,255], and some have names containing spaces. However, in the X Window System, lettercase and spaces are ignored, so light blue, lightblue, and lightBLUE, are equivalent.

For your convenience, two views of the X Window System's named colors are provided: sorted by name and sorted by hexadecimal values.

Most X11 applications accept command-line arguments of -bg and -fg to specify the background (screen) and foreground (text) colors, and some also accept -cr and -ms for cursor and mouse colors. Here is an example:

% emacs -bg pink -fg black -cr blue -ms 'medium slate blue' &


X11 colors can also be specified with three, six, nine, or twelve hexadecimal digits, prefixed with a sharp: #3fe, #33ffb0, #333fffe12, and #ffff88884444. The intensity scales are then [0,15], [0,255], [0,4095], and [0,65535], respectively. Six-digit specifications are most common, since few workstations provide more than 256 intensity levels for each of the three primary colors.

3.   How can I pick colors visually?

We are still trying to find good portable tools for this job. On some GNU/Linux systems, kcoloredit and a locally written tool, color-picker are available. kcoloredit is installed on our FreeBSD system, and color-picker is also installed on our Solaris 9 and 10 systems.

Most of our systems have xpaint, in which you can follow the menu path

Canvas -> New Canvas -> Selectors -> Color and Pattern Selector


to reach a color wheel in which you can move a dot and get a report of red, green and blue values, but no output of X Window System hexadecimal color values.

Another approach is to use a standard tool in the Tk system:

% echo 'tk_chooseColor ; exit' | wish


That gives you slider bars for selecting the red, green, and blue intensities, showing the resulting mixture in a colored box. Unfortunately, the RGB color model is hard for humans to manipulate, so it can be difficult to find the right combination of primary colors to produce the color blend that you want, and you'll have to do the conversion to hexadecimal yourself for the X Window System.

On other systems, for now, you may have to resort to guessing, possibly by tweaking intensity levels of named colors that are close to what you want.

4.   I picked a nice color for my screen, but found that it looks different on other displays and on printers. Why?

Color fidelity and reproducibility is a big problem in the computing industry. While it is possible on some systems with the help of an accurate color meter to adjust display and printer colors to match an official color scale, such as the Pantone system, few sites outside the color printing industry do so. A summary Pantone chart is available online, but it is of limited utility, since its appearance depends on your display: only an official printed chart is usable for calibration.

CRT displays, in particular, may change in color as the display ages, the intensity is adjusted, or the room lighting changes. In addition, color perception varies among individuals. For example, from 6% to 12% of the male population has some degree of red-green color blindness , and a few have difficulty with blue and yellow.

5.   How do I use color in LaTeX?

This is a very complex topic: see The LaTeX Graphics Companion (ISBN 0-201-85469-4), and material scattered through The LaTeX Companion (second edition, ISBN 0-201-36299-6).

The locally written rgb package makes all of the X11 color names available in LaTeX, so that you can do something like this:

\documentclass{...}

\usepackage{color}
\usepackage{rgb}

\begin{document}
...
\textcolor{lightsteelblue}{This is colored text.}
...
\end{document}


The locally written coloralias package allows you to define aliases for color names, so that you can parametrize them with easily changeable symbolic names at top level:

\documentclass{...}

\usepackage{color}
\usepackage{coloralias}
\usepackage{rgb}

\definecoloralias{highlightcolor}{goldenrod}
\definecoloralias{textcolor}{black}

\begin{document}
...
\fcolorbox{textcolor}{highlightcolor}{This is boxed highlighted text.}
...
\end{document}

6.   Are there guidelines for design with color?

Yes. Particularly good book references are Jan White's Color for the Electronic Age (ISBN 0-8230-0732-4) and Edward Tufte's timeless trilogy The Visual Display of Quantitative Information (ISBN 0-9613921-0-X), Envisioning Information (no ISBN), and Visual Explanations: Images and Quantities, Evidence and Narrative (ISBN 0-9613921-2-6).

On the Web, Aries Arditi's document Effective Color Contrast: Designing for People with Partial Sight and Color Deficiencies contains helpful advice.

Dept Info Outreach College of Science Newsletter

Department of Mathematics
University of Utah
155 South 1400 East, JWB 233
Salt Lake City, Utah 84112-0090
Tel: 801 581 6851, Fax: 801 581 4148
Webmaster

Entire Web                     Only http://www.math.utah.edu/