Java tip: SystemColors for Windows Vista user interface themes

Technologies: Java 5+

Each Windows Vista theme sets the desktop image, screen saver, sound set, mouse pointer shapes, and color scheme for window frames, buttons, scroll bars, and all other user interface components. For Java applications, changing the theme also sets colors in Java's java.awt.SystemColor objects, which applications may use to customize user interfaces to match the Windows theme.

This article discusses SystemColor problems on Windows Vista, and provides color swatches, RGB/HSV values, and downloadable color lists for all SystemColors for each of the standard Windows Vista themes.

This article is part of a series on How to use SystemColors to access OS user interface theme colors that catalogs Java's SystemColors for user interface themes in major OSes. The color catalogs provide a resource for comparing theme colors and creating custom Java components that match the themes.

Accessing Windows Vista theme colors from Java

A Windows Vista theme defines the color scheme and style for window frames, buttons, scrollbars, and other user interface components. Windows Vista's glassy translucent blue window frames, window drop shadows, and shiny buttons, tabs, menus, and scrollbars are all part of its theme.

Java's java.awt.SystemColor class provides Java application access to the colors used by well-defined parts of a theme, such as the foreground and background colors for buttons, text fields, and menus. Each of these theme parts has its own statically-defined SystemColor object. For instance, SystemColor.textHighlight is the background color for selected text in a text field.

A list of SystemColor objects and their use is discussed further in the lead series article. The following article discusses Windows Vista-specific issues, summarizes user theme choices, and provides color swatches and RGB values for theme SystemColors.

Selecting Windows Vista themes

Briefly, Windows Vista themes are adjusted using a series of control panels accessed from the Personalization control panel:

Windows Vista Personalization control panel
Figure 1. Theme components in the
Windows Vista Personalization control panel.

Clicking on the Theme link displays the Theme Settings control panel from which preset themes may be selected, but not changed:

Windows Vista Theme Settings control panel
Figure 2. Theme selections in the
Windows Vista Theme Settings control panel.

Windows Vista includes just two theme presets: Windows Vista and Windows Classic. Digging deeper into control panels, however, reveals multiple variants of each preset.

The Windows Vista preset defaults to the new Aero theme style with a translucent glassy tinted window frame. The Windows Classic preset instead reproduces the non-glassy look of Windows 95 and 98 themes. The rounded look of Windows XP is no longer available (see the article on SystemColors for Windows XP user interface themes).

Aero window frame tint color

With an Aero theme in use, clicking on the Window Color and Appearance link back in the Personalization control panel shows a second page for selecting the tint color of the window frame:

Windows Vista Aero Window Color control panel
Figure 2. Aero theme window frame tint controls using the
Windows Vista Window Color control panel.

Window and button styles and colors

Two user interface paths lead to the same Appearance Settings control panel and a list of window and button styles and color schemes:

  • For Aero themes, clicking on the Open classic appearance properties for more color options link at the bottom of the tint control panel shows the Appearance Settings control panel.
  • For non-Aero themes, the tint control panel is not available. Instead, clicking on the Window Color and Appearance link on the Personalization control panel's first page shows the Appearance Settings control panel.
Windows Vista Appearance Settings control panel
Figure 3. Theme selections in the
Windows Vista Appearance Settings control panel.

Windows Vista includes three main window and button styles:

  • Windows Aero draws windows with the translucent window frame and shaded buttons shown above.
  • Windows Vista Basic draws windows with a similar look to Aero, but without the translucency effects.
  • Windows Classic themes draw windows with sharp corners, a simpler left-to-right gradient title bar, and simpler window buttons. Components have a flat, beveled appearance.

The Windows Aero and Windows Vista Basic styles are new in Windows Vista. The Windows Classic themes mimic the look of Windows 95 and Windows 98.

Clicking on the Advanced button on the Appearance Settings control panel displays the Advanced Appearance control panel for setting the individual colors, fonts, and sizes of a theme:

Windows Vista Advanced Appearance control panel
Figure 4. Theme controls in the
Windows Vista Advanced Appearance control panel.

Dealing with Windows Vista SystemColor problems

Java's SystemColor class is a flawed approach to accessing OS theme settings. While colors are defined for button backgrounds and text, none are defined for tabs, checkboxes, radio buttons, progress bars, and more. Though a highlight color is defined for selected text, none are defined for selected menu items, toggle buttons, radio buttons, or checkboxes. Beyond colors, Java has no access to OS theme fonts, button styles, window title bar buttons, and so forth. So, while there are specific problems on Windows (and every OS), the primary problem is that Java's theme access is flawed.

Some specific problems on Windows Vista include:

  • SystemColor.activeCaption and SystemColor.inactiveCaption provide the window title bar background color for front and back windows.
    • When using the Aero theme, neither SystemColor contains the translucent window tint color. Instead, they're both set to light blues.
    • When using the Basic and Classic themes, the SystemColors only include the starting color for title bar gradients. There is no SystemColor for the ending gradient color.
    • While the user can set gradient colors in the Advanced Appearance control panel, the Aero and Basic themes ignore these colors. Only the Classic themes use the user's title bar color choices. Nevertheless, the user's color choices do set Java's SystemColors, even when they're ignored by Aero and Basic themes.
    • Though the Basic theme mimics the Aero theme without translucency, the window tint color control panel is unavailable. Since the Advanced Appearance title bar color is ignored by the Basic theme, the user is left with no way to change the window tint. The corresponding SystemColors are always light blue.
  • SystemColor.activeCaptionBorder and SystemColor.inactiveCaptionBorder hold the border color of front and back windows.
    • When using the Aero theme, the user's selected window tint color is used for the window borders. But the SystemColors don't reflect the tint choice and remain gray and white.
    • While the user can set the border colors in the Advanced Appearance control panel and for the corresponding Java SystemColors, the Aero and Basic themes ignore the colors and draw their own glassy borders. Only the Classic themes use the border colors.
  • SystemColor.desktop gives the desktop color.
    • Most users use a favorite image as their desktop and never touch the desktop color setting. SystemColor.desktop is unlikely to have a color anything like the user's desktop image.
  • SystemColor.control indicates the background color for buttons, tabs, etc.
    • While the user can set the control color in the Advanced Appearance control panel and for the corresponding Java SystemColor, the Aero and Basic themes always draw their own beige shaded buttons, scrollbars, etc. On these themes, the control color is only used for window backgrounds. The Classic themes, however, use the control color for their buttons.
  • SystemColor.menu gives the background color for menus.
    • While the user can set the menu color in the Advanced Appearance control panel and for the corresponding Java SystemColor, the color is ignored when using the Aero and Basic themes. Menus on those themes always use the window background color. Only the Classic themes pay attention to the menu color.

Because of these problems, the title bar, menu, desktop, and control colors reported by the SystemColor class may or may not match those actually in use by Windows Vista. Since Java applications cannot tell what type of theme is in use, they cannot determine when the SystemColors do or do not mean anything.

None of these have workarounds. While the SystemColor class is intended to indicate the OS's theme color scheme, it doesn't work very well.

Similar problems are found for SystemColors on Windows XP and Windows 7.

Color swatches and values

Selecting a new theme or changing any of the theme's colors immediately updates one or more Java SystemColors.

Aero themes

The glassy Windows Aero theme is the default for PCs with newer graphics cards. The theme uses a translucent rounded window frame that blurs whatever is behind it. It also includes window drop shadows, large shiny title bar buttons, a white glow on the window title, and glossy gradient backgrounds for buttons and combo boxes.

Windows Vista Aero theme
Name Hex triplet Red Green Blue Hue Satur. Value
activeCaption #99b4d1 153 180 209 211 26 81
activeCaptionBorder #b4b4b4 180 180 180 0 0 70
activeCaptionText #000000 0 0 0 0 0 0
control #f0f0f0 240 240 240 0 0 94
controlDkShadow #696969 105 105 105 0 0 41
controlHighlight #e3e3e3 227 227 227 0 0 89
controlLtHighlight #ffffff 255 255 255 0 0 100
controlShadow #a0a0a0 160 160 160 0 0 62
controlText #000000 0 0 0 0 0 0
desktop #000000 0 0 0 0 0 0
inactiveCaption #bfcddb 191 205 219 210 12 85
inactiveCaptionBorder #f4f7fc 244 247 252 217 3 98
inactiveCaptionText #434e54 67 78 84 201 20 32
info #ffffe1 255 255 225 59 11 100
infoText #000000 0 0 0 0 0 0
menu #f0f0f0 240 240 240 0 0 94
menuText #000000 0 0 0 0 0 0
scrollbar #c8c8c8 200 200 200 0 0 78
text #ffffff 255 255 255 0 0 100
textHighlight #3399ff 51 153 255 210 80 100
textHighlightText #ffffff 255 255 255 0 0 100
textInactiveText #808080 128 128 128 0 0 50
textText #000000 0 0 0 0 0 0
window #ffffff 255 255 255 0 0 100
windowBorder #646464 100 100 100 0 0 39
windowText #000000 0 0 0 0 0 0

Basic themes

The Windows Vista Basic theme is used for PCs with older graphics cards that aren't fast enough to handle the transparency effects of the Aero theme. The Windows Vista Basic theme uses the same color scheme as Aero, but draws an opaque window border with smaller title bar buttons.

Windows Vista Basic theme
Name Hex triplet Red Green Blue Hue Satur. Value
activeCaption #99b4d1 153 180 209 211 26 81
activeCaptionBorder #b4b4b4 180 180 180 0 0 70
activeCaptionText #000000 0 0 0 0 0 0
control #f0f0f0 240 240 240 0 0 94
controlDkShadow #696969 105 105 105 0 0 41
controlHighlight #e3e3e3 227 227 227 0 0 89
controlLtHighlight #ffffff 255 255 255 0 0 100
controlShadow #a0a0a0 160 160 160 0 0 62
controlText #000000 0 0 0 0 0 0
desktop #000000 0 0 0 0 0 0
inactiveCaption #bfcddb 191 205 219 210 12 85
inactiveCaptionBorder #f4f7fc 244 247 252 217 3 98
inactiveCaptionText #434e54 67 78 84 201 20 32
info #ffffe1 255 255 225 59 11 100
infoText #000000 0 0 0 0 0 0
menu #f0f0f0 240 240 240 0 0 94
menuText #000000 0 0 0 0 0 0
scrollbar #c8c8c8 200 200 200 0 0 78
text #ffffff 255 255 255 0 0 100
textHighlight #3399ff 51 153 255 210 80 100
textHighlightText #ffffff 255 255 255 0 0 100
textInactiveText #808080 128 128 128 0 0 50
textText #000000 0 0 0 0 0 0
window #ffffff 255 255 255 0 0 100
windowBorder #646464 100 100 100 0 0 39
windowText #000000 0 0 0 0 0 0

Classic themes

The Classic themes recreate the look of Windows 95 and 98 with squared window corners, a gradient title bar, and beveled buttons, scrollbars, and tabs.

Windows Classic theme

Vista's Windows Classic theme is identical to Windows XP's Classic theme. The theme uses black text on a blue-gray background with dark blue highlights. The window title bar's lighter blue secondary color is not represented in Java's SystemColor set.

Windows Vista classic theme
Name Hex triplet Red Green Blue Hue Satur. Value
activeCaption #000080 0 0 128 240 100 50
activeCaptionBorder #c0c0c0 192 192 192 0 0 75
activeCaptionText #ffffff 255 255 255 0 0 100
control #c0c0c0 192 192 192 0 0 75
controlDkShadow #000000 0 0 0 0 0 0
controlHighlight #c0c0c0 192 192 192 0 0 75
controlLtHighlight #ffffff 255 255 255 0 0 100
controlShadow #808080 128 128 128 0 0 50
controlText #000000 0 0 0 0 0 0
desktop #3a6ea5 58 110 165 210 64 64
inactiveCaption #808080 128 128 128 0 0 50
inactiveCaptionBorder #c0c0c0 192 192 192 0 0 75
inactiveCaptionText #c0c0c0 192 192 192 0 0 75
info #ffffe1 255 255 225 59 11 100
infoText #000000 0 0 0 0 0 0
menu #c0c0c0 192 192 192 0 0 75
menuText #000000 0 0 0 0 0 0
scrollbar #c0c0c0 192 192 192 0 0 75
text #ffffff 255 255 255 0 0 100
textHighlight #000080 0 0 128 240 100 50
textHighlightText #ffffff 255 255 255 0 0 100
textInactiveText #808080 128 128 128 0 0 50
textText #000000 0 0 0 0 0 0
window #ffffff 255 255 255 0 0 100
windowBorder #000000 0 0 0 0 0 0
windowText #000000 0 0 0 0 0 0

Windows Standard theme

The Windows Standard in Windows Vista is identical to the Standard theme in Windows XP. The theme brightens the old Classic theme's colors to lighter blues and a beige background. The window title bar's light blue secondary color is not represented in Java's SystemColor set.

Windows Vista Standard theme
Name Hex triplet Red Green Blue Hue Satur. Value
activeCaption #0a246a 10 36 106 223 90 41
activeCaptionBorder #d4d0c8 212 208 200 29 3 81
activeCaptionText #ffffff 255 255 255 0 0 100
control #d4d0c8 212 208 200 29 3 81
controlDkShadow #404040 64 64 64 0 0 25
controlHighlight #d4d0c8 212 208 200 29 3 81
controlLtHighlight #ffffff 255 255 255 0 0 100
controlShadow #808080 128 128 128 0 0 50
controlText #000000 0 0 0 0 0 0
desktop #3a6ea5 58 110 165 210 64 64
inactiveCaption #808080 128 128 128 0 0 50
inactiveCaptionBorder #d4d0c8 212 208 200 29 3 81
inactiveCaptionText #d4d0c8 212 208 200 29 3 81
info #ffffe1 255 255 225 59 11 100
infoText #000000 0 0 0 0 0 0
menu #d4d0c8 212 208 200 29 3 81
menuText #000000 0 0 0 0 0 0
scrollbar #d4d0c8 212 208 200 29 3 81
text #ffffff 255 255 255 0 0 100
textHighlight #0a246a 10 36 106 223 90 41
textHighlightText #ffffff 255 255 255 0 0 100
textInactiveText #808080 128 128 128 0 0 50
textText #000000 0 0 0 0 0 0
window #ffffff 255 255 255 0 0 100
windowBorder #000000 0 0 0 0 0 0
windowText #000000 0 0 0 0 0 0

High contrast classic themes

The High Contrast themes are intended for the visually impaired. They have the same window and component shapes as the Classic themes, but with a high-contrast color palette and no bevels and gradients. The High Contrast themes were also available in Windows XP. Vista makes some minor color changes on a few of them.

High Contrast 1 theme

The High Contrast 1 theme uses yellow text on a black background with green highlights.

Windows Vista High Contrast 1 theme
Name Hex triplet Red Green Blue Hue Satur. Value
activeCaption #0000ff 0 0 255 240 100 100
activeCaptionBorder #0000ff 0 0 255 240 100 100
activeCaptionText #ffffff 255 255 255 0 0 100
control #000000 0 0 0 0 0 0
controlDkShadow #ffffff 255 255 255 0 0 100
controlHighlight #ffffff 255 255 255 0 0 100
controlLtHighlight #c0c0c0 192 192 192 0 0 75
controlShadow #808080 128 128 128 0 0 50
controlText #ffffff 255 255 255 0 0 100
desktop #000000 0 0 0 0 0 0
inactiveCaption #00ffff 0 255 255 180 100 100
inactiveCaptionBorder #00ffff 0 255 255 180 100 100
inactiveCaptionText #000000 0 0 0 0 0 0
info #000000 0 0 0 0 0 0
infoText #ffff00 255 255 0 59 100 100
menu #000000 0 0 0 0 0 0
menuText #ffffff 255 255 255 0 0 100
scrollbar #000000 0 0 0 0 0 0
text #000000 0 0 0 0 0 0
textHighlight #008000 0 128 0 120 100 50
textHighlightText #ffffff 255 255 255 0 0 100
textInactiveText #00ff00 0 255 0 120 100 100
textText #ffff00 255 255 0 59 100 100
window #000000 0 0 0 0 0 0
windowBorder #ffffff 255 255 255 0 0 100
windowText #ffff00 255 255 0 59 100 100

High Contrast 2 theme

The High Contrast 2 theme uses green text on a black background with blue highlights. Compared to the same theme in Windows XP, only the textInactiveText color has changed (from green to gray).

Windows Vista High Contrast 2 theme
Name Hex triplet Red Green Blue Hue Satur. Value
activeCaption #00ffff 0 255 255 180 100 100
activeCaptionBorder #00ffff 0 255 255 180 100 100
activeCaptionText #000000 0 0 0 0 0 0
control #000000 0 0 0 0 0 0
controlDkShadow #ffffff 255 255 255 0 0 100
controlHighlight #ffffff 255 255 255 0 0 100
controlLtHighlight #c0c0c0 192 192 192 0 0 75
controlShadow #808080 128 128 128 0 0 50
controlText #00ff00 0 255 0 120 100 100
desktop #000000 0 0 0 0 0 0
inactiveCaption #0000ff 0 0 255 240 100 100
inactiveCaptionBorder #0000ff 0 0 255 240 100 100
inactiveCaptionText #ffffff 255 255 255 0 0 100
info #ffff00 255 255 0 59 100 100
infoText #000000 0 0 0 0 0 0
menu #000000 0 0 0 0 0 0
menuText #00ff00 0 255 0 120 100 100
scrollbar #000000 0 0 0 0 0 0
text #000000 0 0 0 0 0 0
textHighlight #0000ff 0 0 255 240 100 100
textHighlightText #ffffff 255 255 255 0 0 100
textInactiveText #c0c0c0 192 192 192 0 0 75
textText #00ff00 0 255 0 120 100 100
window #000000 0 0 0 0 0 0
windowBorder #ffffff 255 255 255 0 0 100
windowText #00ff00 0 255 0 120 100 100

High Contrast Black theme

The High Contrast Black theme uses white text on a black background with magenta highlights.

Windows Vista High Contrast Black theme
Name Hex triplet Red Green Blue Hue Satur. Value
activeCaption #800080 128 0 128 300 100 50
activeCaptionBorder #ffff00 255 255 0 59 100 100
activeCaptionText #ffffff 255 255 255 0 0 100
control #000000 0 0 0 0 0 0
controlDkShadow #ffffff 255 255 255 0 0 100
controlHighlight #ffffff 255 255 255 0 0 100
controlLtHighlight #c0c0c0 192 192 192 0 0 75
controlShadow #808080 128 128 128 0 0 50
controlText #ffffff 255 255 255 0 0 100
desktop #000000 0 0 0 0 0 0
inactiveCaption #008000 0 128 0 120 100 50
inactiveCaptionBorder #008000 0 128 0 120 100 50
inactiveCaptionText #ffffff 255 255 255 0 0 100
info #000000 0 0 0 0 0 0
infoText #ffffff 255 255 255 0 0 100
menu #000000 0 0 0 0 0 0
menuText #ffffff 255 255 255 0 0 100
scrollbar #000000 0 0 0 0 0 0
text #000000 0 0 0 0 0 0
textHighlight #800080 128 0 128 300 100 50
textHighlightText #ffffff 255 255 255 0 0 100
textInactiveText #00ff00 0 255 0 120 100 100
textText #ffffff 255 255 255 0 0 100
window #000000 0 0 0 0 0 0
windowBorder #ffffff 255 255 255 0 0 100
windowText #ffffff 255 255 255 0 0 100

High Contrast White theme

The High Contrast White theme uses black text on a white background, and inverts the text and background colors for text highlighting.

Windows Vista High Contrast White theme
Name Hex triplet Red Green Blue Hue Satur. Value
activeCaption #000000 0 0 0 0 0 0
activeCaptionBorder #808080 128 128 128 0 0 50
activeCaptionText #ffffff 255 255 255 0 0 100
control #ffffff 255 255 255 0 0 100
controlDkShadow #000000 0 0 0 0 0 0
controlHighlight #c0c0c0 192 192 192 0 0 75
controlLtHighlight #c0c0c0 192 192 192 0 0 75
controlShadow #808080 128 128 128 0 0 50
controlText #000000 0 0 0 0 0 0
desktop #ffffff 255 255 255 0 0 100
inactiveCaption #ffffff 255 255 255 0 0 100
inactiveCaptionBorder #c0c0c0 192 192 192 0 0 75
inactiveCaptionText #000000 0 0 0 0 0 0
info #ffffff 255 255 255 0 0 100
infoText #000000 0 0 0 0 0 0
menu #ffffff 255 255 255 0 0 100
menuText #000000 0 0 0 0 0 0
scrollbar #ffffff 255 255 255 0 0 100
text #ffffff 255 255 255 0 0 100
textHighlight #000000 0 0 0 0 0 0
textHighlightText #ffffff 255 255 255 0 0 100
textInactiveText #00ff00 0 255 0 120 100 100
textText #000000 0 0 0 0 0 0
window #ffffff 255 255 255 0 0 100
windowBorder #000000 0 0 0 0 0 0
windowText #000000 0 0 0 0 0 0

Downloads

Each theme's SystemColor set is available as a download in the X11 rgb.txt file format:

Further reading

Related articles at NadeauSoftware.com

Web articles

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

Nadeau software consulting
Nadeau software consulting