[ Go to October 1997 Table of Contents ]

Optimizing Windows /
John Woram

Color-Code Your Desktop

I guess I'm not the only one who likes to "fix" things that aren't really broken. My April column on changing the color of an open folder in Explorer or the Registry Editor drew an amazing amount of reader response. Based on that, I thought I'd meddle once again with other Windows color schemes and offer a few previews of what to look for in the upcoming Windows 98 (any day now, any day)

Desktop decorators have been changing the default Windows color scheme for years, first with the Windows 3.x Color applet, and now via the Display Properties Appearance tab. Such changes show up immediately in the tab's own Desktop-preview window, and take effect on the actual Desktop when you click on the Apply button. However, there are still a few components you can't alter from here, and you'll have to edit the Registry if you want to change them. You'll find all these color components in the HKEY_CURRENT_USER\Control Panel\Colors subkey. Each is defined by three decimal numbers indicating the red, green and blue (RGB) components of the color. Thus, 255 0 0 is red-only, 0 255 255 is cyan and so on.

If you're not sure of the right values for a specific color, you can coax the information out of Windows. If the desired color is already visible on the Appearance tab, just point to it and then click on the down arrow next to the Color box. Click on the Other button at the bottom of the drop-down color palette. In three boxes in the lower right corner of the Color dialog box, you'll see the RGB components of the color that you selected. Point to any other color in the Basic colors matrix, and its RGB components will be listed there instead.

To specify a custom color, move the mouse pointer around in the square Color Matrix box, and watch the color change in the smaller Color|Solid box below it. Then adjust the color brightness (luminosity) by moving the vertical left arrow at the extreme right side of the dialog box. When you have the color you want, jot down the numbers in the Red, Green and Blue boxes and repeat the procedure for any other color combination you need. Now use these numbers to edit the desired Registry entry. These changes take effect the next time you restart Windows.

Now, let's look at a few of the Desktop components that can be changed only by this method.

3D objects

When it comes to color coordination, those "simple" gray buttons in any Windows application are anything but simple. The 3D effect is created by four horizontal/vertical line segments, each in a different color (white, light gray, dark gray and black are the defaults). In addition, a thin black frame surrounds the entire button. Counting the button face itself and the text on it, you have a total of seven colors-even if three of them are black. If you don't remember seeing controls for so many components, you're right. Except for text color, the single 3D Objects item controls all of them. The selected color becomes the button face, and the four shadow lines surrounding it change automatically. To independently change these components, edit any Buttonxxxx entry, where xxxx identifies the specific component. For example, ButtonShadow is the dark gray line segment immediately below and to the right of the button face. The WindowFrame entry specifies the color of the thin line surrounding the entire button structure.

The button is not the only 3D object on the Desktop. Each open window is itself a 3D object. So are the various tabs in a Properties dialog box and elsewhere. Any change made to a 3D Object component will show up at various other locations on the Windows 95 Desktop. The WindowFrame color may be most apparent as the line that surrounds a drop-down list, for example.

Disabled option

The Registry's GrayText entry specifies the color of text on a button or menu option if that item is currently unavailable. For example, if no text is highlighted in a word processor, its Cut and Copy options are disabled ("grayed"). The same rule applies to the Paste options on the same menu if Clipboard is empty. Highlight any text, and the first two options come to life. Cut or copy the text, and the other two options lose their gray pallor.

By default, disabled text is gray (128 128 128), and enabled text is black (0 0 0). If you change the GrayText entry to blue (0 0 255) or any other color, you may or may not see the effect on disabled buttons and menu options-it seems to depend on the specific video driver or Windows version. To determine if a change will show up on your menus and buttons, take a close look at the present disabled-option lettering. If it has an "engraved" appearance, a color change will have no effect. But if the letters are no different than enabled letters-except they're grayed out-then a color change will show up.

In either case, you will see the effect of a GrayText color change elsewhere. Select Device Manager's Performance tab and then click on the Virtual Memory button. If the radio button next to "Let Windows manage my virtual memory settings" is enabled, the text in the disabled boxes immediately below will display the new color. Toggle the radio buttons back and forth, and the color toggles, too. Then click on the Cancel button so your actions in Device Manager have no permanent effect. You'll see the same effect in other windows where text lines may be disabled.

The disabled-text color will show up in one other place-or in the following example, won't show up. Change GrayText to white (255 255 255), and then look at any Explorer or Registry Editor window. Remember all those lines between folders and subfolders? They're all gone now, because these lines are also drawn in the GrayText color, which means they're white on white.

Coming soon, to a Desktop near you . . .

Users of the Microsoft Office shortcut bar already know about the color Gradient Fill option available via the Customize option. If checked, the selected color gets progressively lighter across the longest dimension of the shortcut bar. Barring any last-minute changes, Windows 98 will apply the same capability to all title bars. You'll find two color boxes to the right of the Item drop-down list. The Color 1 box identifies the color of the selected item, as in all current versions of Windows 95. The adjacent Color 2 box is enabled if either the Active or Inactive Title Bar item is selected, and it specifies the color seen at the opposite end of the title bar. The higher the color depth, the smoother the gradient between the two colors. It's not very good at 256 colors, and even worse at 16, so you might want to limit its use to 16,000 colors or better.

A Custom Color footnote

If you save a custom color by clicking on the Add to Custom Colors button in the Color dialog box, that color's RGB component is written into a CustomColors entry in the Registry's HKCU\ControlPanel\Appearance subkey. If you open that key before defining any custom colors, the CustomColors Data stream shows a repetitive four-byte FF FF FF 00 sequence. Each one represents the RGB0 component of a single custom color (even at 32-bit color, the fourth byte remains zero), and for the moment all the colors are white. If you highlight one of the empty (white) boxes in the Custom Colors section and then select a custom set of RGB values, those values will be written into the appropriate location in the CustomColors Data stream when you click on the Add to Custom Colors button. By contrast, the MS Paint applet stores its custom colors in a 128-byte filename.PAL file.

And speaking of title bars, you may notice that if you change the font or font size for either one, the other changes, too. That's because both items point to the same entry (CaptionFont) in the HKCU\Control Panel\Desktop\WindowMetrics key. There, typeface, point size and other font characteristics are specified in a 50-byte sequence that the Registry calls a "binary value" and then displays as a hexadecimal string. But that's another column.

Get the Gray Out
Disabled options may be displayed in an "engraved" style as shown by the magnified Cut option, or as the plain gray text shown here by the Paste option. When you edit the GrayText color, only the latter style will display the new color as shown here by the Paste Special option.

Lose the Lines
Is something missing? If the Registry's GrayText entry is white (0 0 0), the lines that usually link folders (and here, Registry keys) are white-on-white, and therefore invisible.

Consulting editor John Woram is the author of The Windows 95 Registry: A Survival Guide for Users (MIS: Press, 1996). Contact John care of the editor or the addresses on page 20.


Windows Magazine, October 1997, page 266.

[ Go to October 1997 Table of Contents ]