SystemColor (Java SE 26 & JDK 26)
Description: declaration: module: java.desktop, package: java.awt, class: SystemColor
Keywords: java.awt.SystemColor class

# Class SystemColor

java.lang.Object
java.awt.Color
java.awt.SystemColor

All Implemented Interfaces:
  `Paint, Transparency, Serializable`

public final class SystemColor extends Color implements Serializable
A class to encapsulate symbolic colors representing the color of native GUI objects on a system. For systems which support the dynamic update of the system colors (when the user changes the colors) the actual RGB values of these symbolic colors will also change dynamically. In order to compare the "current" RGB value of a `SystemColor` object with a non-symbolic Color object, `getRGB` should be used rather than `equals`.

Note that the way in which these system colors are applied to GUI objects may vary slightly from platform to platform since GUI objects may be rendered differently on each platform.

System color values may also be available through the `getDesktopProperty` method on `java.awt.Toolkit`.

See Also:
  - `Toolkit.getDesktopProperty(String)`
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `ACTIVE_CAPTION`
  The array index for the `activeCaption` system color.
  `static final int`
  `ACTIVE_CAPTION_BORDER`
  The array index for the `activeCaptionBorder` system color.
  `static final int`
  `ACTIVE_CAPTION_TEXT`
  The array index for the `activeCaptionText` system color.
  `static final SystemColor`
  `activeCaption`
  The color rendered for the window-title background of the currently active window.
  `static final SystemColor`
  `activeCaptionBorder`
  The color rendered for the border around the currently active window.
  `static final SystemColor`
  `activeCaptionText`
  The color rendered for the window-title text of the currently active window.
  `static final SystemColor`
  `control`
  The color rendered for the background of control panels and control objects, such as pushbuttons.
  `static final int`
  `CONTROL`
  The array index for the `control` system color.
  `static final int`
  `CONTROL_DK_SHADOW`
  The array index for the `controlDkShadow` system color.
  `static final int`
  `CONTROL_HIGHLIGHT`
  The array index for the `controlHighlight` system color.
  `static final int`
  `CONTROL_LT_HIGHLIGHT`
  The array index for the `controlLtHighlight` system color.
  `static final int`
  `CONTROL_SHADOW`
  The array index for the `controlShadow` system color.
  `static final int`
  `CONTROL_TEXT`
  The array index for the `controlText` system color.
  `static final SystemColor`
  `controlDkShadow`
  The color rendered for dark shadow areas on 3D control objects, such as pushbuttons.
  `static final SystemColor`
  `controlHighlight`
  The color rendered for light areas of 3D control objects, such as pushbuttons.
  `static final SystemColor`
  `controlLtHighlight`
  The color rendered for highlight areas of 3D control objects, such as pushbuttons.
  `static final SystemColor`
  `controlShadow`
  The color rendered for shadow areas of 3D control objects, such as pushbuttons.
  `static final SystemColor`
  `controlText`
  The color rendered for the text of control panels and control objects, such as pushbuttons.
  `static final SystemColor`
  `desktop`
  The color rendered for the background of the desktop.
  `static final int`
  `DESKTOP`
  The array index for the `desktop` system color.
  `static final int`
  `INACTIVE_CAPTION`
  The array index for the `inactiveCaption` system color.
  `static final int`
  `INACTIVE_CAPTION_BORDER`
  The array index for the `inactiveCaptionBorder` system color.
  `static final int`
  `INACTIVE_CAPTION_TEXT`
  The array index for the `inactiveCaptionText` system color.
  `static final SystemColor`
  `inactiveCaption`
  The color rendered for the window-title background of inactive windows.
  `static final SystemColor`
  `inactiveCaptionBorder`
  The color rendered for the border around inactive windows.
  `static final SystemColor`
  `inactiveCaptionText`
  The color rendered for the window-title text of inactive windows.
  `static final SystemColor`
  `info`
  The color rendered for the background of tooltips or spot help.
  `static final int`
  `INFO`
  The array index for the `info` system color.
  `static final int`
  `INFO_TEXT`
  The array index for the `infoText` system color.
  `static final SystemColor`
  `infoText`
  The color rendered for the text of tooltips or spot help.
  `static final SystemColor`
  `menu`
  The color rendered for the background of menus.
  `static final int`
  `MENU`
  The array index for the `menu` system color.
  `static final int`
  `MENU_TEXT`
  The array index for the `menuText` system color.
  `static final SystemColor`
  `menuText`
  The color rendered for the text of menus.
  `static final int`
  `NUM_COLORS`
  The number of system colors in the array.
  `static final SystemColor`
  `scrollbar`
  The color rendered for the background of scrollbars.
  `static final int`
  `SCROLLBAR`
  The array index for the `scrollbar` system color.
  `static final SystemColor`
  `text`
  The color rendered for the background of text control objects, such as textfields and comboboxes.
  `static final int`
  `TEXT`
  The array index for the `text` system color.
  `static final int`
  `TEXT_HIGHLIGHT`
  The array index for the `textHighlight` system color.
  `static final int`
  `TEXT_HIGHLIGHT_TEXT`
  The array index for the `textHighlightText` system color.
  `static final int`
  `TEXT_INACTIVE_TEXT`
  The array index for the `textInactiveText` system color.
  `static final int`
  `TEXT_TEXT`
  The array index for the `textText` system color.
  `static final SystemColor`
  `textHighlight`
  The color rendered for the background of selected items, such as in menus, comboboxes, and text.
  `static final SystemColor`
  `textHighlightText`
  The color rendered for the text of selected items, such as in menus, comboboxes, and text.
  `static final SystemColor`
  `textInactiveText`
  The color rendered for the text of inactive items, such as in menus.
  `static final SystemColor`
  `textText`
  The color rendered for the text of text control objects, such as textfields and comboboxes.
  `static final SystemColor`
  `window`
  The color rendered for the background of interior regions inside windows.
  `static final int`
  `WINDOW`
  The array index for the `window` system color.
  `static final int`
  `WINDOW_BORDER`
  The array index for the `windowBorder` system color.
  `static final int`
  `WINDOW_TEXT`
  The array index for the `windowText` system color.
  `static final SystemColor`
  `windowBorder`
  The color rendered for the border around interior regions inside windows.
  `static final SystemColor`
  `windowText`
  The color rendered for text of interior regions inside windows.

  ### Fields declared in class Color

  `black, BLACK, blue, BLUE, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, GREEN, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, RED, white, WHITE, yellow, YELLOW`
  Modifier and Type
  Field
  Description
  `static final Color`
  `black`
  The color black.
  `static final Color`
  `BLACK`
  The color black.
  `static final Color`
  `blue`
  The color blue.
  `static final Color`
  `BLUE`
  The color blue.
  `static final Color`
  `cyan`
  The color cyan.
  `static final Color`
  `CYAN`
  The color cyan.
  `static final Color`
  `DARK_GRAY`
  The color dark gray.
  `static final Color`
  `darkGray`
  The color dark gray.
  `static final Color`
  `gray`
  The color gray.
  `static final Color`
  `GRAY`
  The color gray.
  `static final Color`
  `green`
  The color green.
  `static final Color`
  `GREEN`
  The color green.
  `static final Color`
  `LIGHT_GRAY`
  The color light gray.
  `static final Color`
  `lightGray`
  The color light gray.
  `static final Color`
  `magenta`
  The color magenta.
  `static final Color`
  `MAGENTA`
  The color magenta.
  `static final Color`
  `orange`
  The color orange.
  `static final Color`
  `ORANGE`
  The color orange.
  `static final Color`
  `pink`
  The color pink.
  `static final Color`
  `PINK`
  The color pink.
  `static final Color`
  `red`
  The color red.
  `static final Color`
  `RED`
  The color red.
  `static final Color`
  `white`
  The color white.
  `static final Color`
  `WHITE`
  The color white.
  `static final Color`
  `yellow`
  The color yellow.
  `static final Color`
  `YELLOW`
  The color yellow.

  ### Fields declared in interface Transparency

  `BITMASK, OPAQUE, TRANSLUCENT`
  Modifier and Type
  Field
  Description
  `static final int`
  `BITMASK`
  Represents image data that is guaranteed to be either completely opaque, with an alpha value of 1.0, or completely transparent, with an alpha value of 0.0.
  `static final int`
  `OPAQUE`
  Represents image data that is guaranteed to be completely opaque, meaning that all pixels have an alpha value of 1.0.
  `static final int`
  `TRANSLUCENT`
  Represents image data that contains or might contain arbitrary alpha values between and including 0.0 and 1.0.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `toString()`
  Returns a string representation of this `Color`'s values.

  ### Methods declared in class Color

  `brighter, createContext, darker, decode, equals, getAlpha, getBlue, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getGreen, getHSBColor, getRed, getRGB, getRGBColorComponents, getRGBComponents, getTransparency, hashCode, HSBtoRGB, RGBtoHSB`
  Modifier and Type
  Method
  Description
  `Color`
  `brighter()`
  Creates a new `Color` that is a brighter version of this `Color`.
  `PaintContext`
  `createContext(ColorModel cm, Rectangle r, Rectangle2D r2d, AffineTransform xform, RenderingHints hints)`
  Creates and returns a `PaintContext` used to generate a solid color field pattern.
  `Color`
  `darker()`
  Creates a new `Color` that is a darker version of this `Color`.
  `static Color`
  `decode(String nm)`
  Converts a `String` to an integer and returns the specified opaque `Color`.
  `boolean`
  `equals(Object obj)`
  Determines whether another object is equal to this `Color`.
  `int`
  `getAlpha()`
  Returns the alpha component in the range 0-255.
  `int`
  `getBlue()`
  Returns the blue component in the range 0-255 in the default sRGB space.
  `static Color`
  `getColor(String nm)`
  Finds a color in the system properties.
  `static Color`
  `getColor(String nm, int v)`
  Finds a color in the system properties.
  `static Color`
  `getColor(String nm, Color v)`
  Finds a color in the system properties.
  `float[]`
  `getColorComponents(float[] compArray)`
  Returns a `float` array containing only the color components of the `Color`, in the `ColorSpace` of the `Color`.
  `float[]`
  `getColorComponents(ColorSpace cspace, float[] compArray)`
  Returns a `float` array containing only the color components of the `Color` in the `ColorSpace` specified by the `cspace` parameter.
  `ColorSpace`
  `getColorSpace()`
  Returns the `ColorSpace` of this `Color`.
  `float[]`
  `getComponents(float[] compArray)`
  Returns a `float` array containing the color and alpha components of the `Color`, in the `ColorSpace` of the `Color`.
  `float[]`
  `getComponents(ColorSpace cspace, float[] compArray)`
  Returns a `float` array containing the color and alpha components of the `Color`, in the `ColorSpace` specified by the `cspace` parameter.
  `int`
  `getGreen()`
  Returns the green component in the range 0-255 in the default sRGB space.
  `static Color`
  `getHSBColor(float h, float s, float b)`
  Creates a `Color` object based on the specified values for the HSB color model.
  `int`
  `getRed()`
  Returns the red component in the range 0-255 in the default sRGB space.
  `int`
  `getRGB()`
  Returns the RGB value representing the color in the default sRGB `ColorModel`.
  `float[]`
  `getRGBColorComponents(float[] compArray)`
  Returns a `float` array containing only the color components of the `Color`, in the default sRGB color space.
  `float[]`
  `getRGBComponents(float[] compArray)`
  Returns a `float` array containing the color and alpha components of the `Color`, as represented in the default sRGB color space.
  `int`
  `getTransparency()`
  Returns the transparency mode for this `Color`.
  `int`
  `hashCode()`
  Computes the hash code for this `Color`.
  `static int`
  `HSBtoRGB(float hue, float saturation, float brightness)`
  Converts the components of a color, as specified by the HSB model, to an equivalent set of values for the default RGB model.
  `static float[]`
  `RGBtoHSB(int r, int g, int b, float[] hsbvals)`
  Converts the components of a color, as specified by the default RGB model, to an equivalent set of values for hue, saturation, and brightness that are the three components of the HSB model.

  ### Methods declared in class Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`
  Modifier and Type
  Method
  Description
  `protected Object`
  `clone()`
  Creates and returns a copy of this object.
  `protected void`
  `finalize()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Finalization is deprecated and subject to removal in a future release.
  `final Class<?>`
  `getClass()`
  Returns the runtime class of this `Object`.
  `final void`
  `notify()`
  Wakes up a single thread that is waiting on this object's monitor.
  `final void`
  `notifyAll()`
  Wakes up all threads that are waiting on this object's monitor.
  `final void`
  `wait()`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted.
  `final void`
  `wait(long timeoutMillis)`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
  `final void`
  `wait(long timeoutMillis, int nanos)`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

- ## Field Details

  - ### DESKTOP

    @Native public static final int DESKTOP
    The array index for the `desktop` system color.
    See Also:
      - `desktop`
      - Constant Field Values

  - ### ACTIVE_CAPTION

    @Native public static final int ACTIVE_CAPTION
    The array index for the `activeCaption` system color.
    See Also:
      - `activeCaption`
      - Constant Field Values

  - ### ACTIVE_CAPTION_TEXT

    @Native public static final int ACTIVE_CAPTION_TEXT
    The array index for the `activeCaptionText` system color.
    See Also:
      - `activeCaptionText`
      - Constant Field Values

  - ### ACTIVE_CAPTION_BORDER

    @Native public static final int ACTIVE_CAPTION_BORDER
    The array index for the `activeCaptionBorder` system color.
    See Also:
      - `activeCaptionBorder`
      - Constant Field Values

  - ### INACTIVE_CAPTION

    @Native public static final int INACTIVE_CAPTION
    The array index for the `inactiveCaption` system color.
    See Also:
      - `inactiveCaption`
      - Constant Field Values

  - ### INACTIVE_CAPTION_TEXT

    @Native public static final int INACTIVE_CAPTION_TEXT
    The array index for the `inactiveCaptionText` system color.
    See Also:
      - `inactiveCaptionText`
      - Constant Field Values

  - ### INACTIVE_CAPTION_BORDER

    @Native public static final int INACTIVE_CAPTION_BORDER
    The array index for the `inactiveCaptionBorder` system color.
    See Also:
      - `inactiveCaptionBorder`
      - Constant Field Values

  - ### WINDOW

    @Native public static final int WINDOW
    The array index for the `window` system color.
    See Also:
      - `window`
      - Constant Field Values

  - ### WINDOW_BORDER

    @Native public static final int WINDOW_BORDER
    The array index for the `windowBorder` system color.
    See Also:
      - `windowBorder`
      - Constant Field Values

  - ### WINDOW_TEXT

    @Native public static final int WINDOW_TEXT
    The array index for the `windowText` system color.
    See Also:
      - `windowText`
      - Constant Field Values

  - ### MENU

    @Native public static final int MENU
    The array index for the `menu` system color.
    See Also:
      - `menu`
      - Constant Field Values

  - ### MENU_TEXT

    @Native public static final int MENU_TEXT
    The array index for the `menuText` system color.
    See Also:
      - `menuText`
      - Constant Field Values

  - ### TEXT

    @Native public static final int TEXT
    The array index for the `text` system color.
    See Also:
      - `text`
      - Constant Field Values

  - ### TEXT_TEXT

    @Native public static final int TEXT_TEXT
    The array index for the `textText` system color.
    See Also:
      - `textText`
      - Constant Field Values

  - ### TEXT_HIGHLIGHT

    @Native public static final int TEXT_HIGHLIGHT
    The array index for the `textHighlight` system color.
    See Also:
      - `textHighlight`
      - Constant Field Values

  - ### TEXT_HIGHLIGHT_TEXT

    @Native public static final int TEXT_HIGHLIGHT_TEXT
    The array index for the `textHighlightText` system color.
    See Also:
      - `textHighlightText`
      - Constant Field Values

  - ### TEXT_INACTIVE_TEXT

    @Native public static final int TEXT_INACTIVE_TEXT
    The array index for the `textInactiveText` system color.
    See Also:
      - `textInactiveText`
      - Constant Field Values

  - ### CONTROL

    @Native public static final int CONTROL
    The array index for the `control` system color.
    See Also:
      - `control`
      - Constant Field Values

  - ### CONTROL_TEXT

    @Native public static final int CONTROL_TEXT
    The array index for the `controlText` system color.
    See Also:
      - `controlText`
      - Constant Field Values

  - ### CONTROL_HIGHLIGHT

    @Native public static final int CONTROL_HIGHLIGHT
    The array index for the `controlHighlight` system color.
    See Also:
      - `controlHighlight`
      - Constant Field Values

  - ### CONTROL_LT_HIGHLIGHT

    @Native public static final int CONTROL_LT_HIGHLIGHT
    The array index for the `controlLtHighlight` system color.
    See Also:
      - `controlLtHighlight`
      - Constant Field Values

  - ### CONTROL_SHADOW

    @Native public static final int CONTROL_SHADOW
    The array index for the `controlShadow` system color.
    See Also:
      - `controlShadow`
      - Constant Field Values

  - ### CONTROL_DK_SHADOW

    @Native public static final int CONTROL_DK_SHADOW
    The array index for the `controlDkShadow` system color.
    See Also:
      - `controlDkShadow`
      - Constant Field Values

  - ### SCROLLBAR

    @Native public static final int SCROLLBAR
    The array index for the `scrollbar` system color.
    See Also:
      - `scrollbar`
      - Constant Field Values

  - ### INFO

    @Native public static final int INFO
    The array index for the `info` system color.
    See Also:
      - `info`
      - Constant Field Values

  - ### INFO_TEXT

    @Native public static final int INFO_TEXT
    The array index for the `infoText` system color.
    See Also:
      - `infoText`
      - Constant Field Values

  - ### NUM_COLORS

    @Native public static final int NUM_COLORS
    The number of system colors in the array.
    See Also:
      - Constant Field Values

  - ### desktop

    public static final SystemColor desktop
    The color rendered for the background of the desktop.

  - ### activeCaption

    public static final SystemColor activeCaption
    The color rendered for the window-title background of the currently active window.

  - ### activeCaptionText

    public static final SystemColor activeCaptionText
    The color rendered for the window-title text of the currently active window.

  - ### activeCaptionBorder

    public static final SystemColor activeCaptionBorder
    The color rendered for the border around the currently active window.

  - ### inactiveCaption

    public static final SystemColor inactiveCaption
    The color rendered for the window-title background of inactive windows.

  - ### inactiveCaptionText

    public static final SystemColor inactiveCaptionText
    The color rendered for the window-title text of inactive windows.

  - ### inactiveCaptionBorder

    public static final SystemColor inactiveCaptionBorder
    The color rendered for the border around inactive windows.

  - ### window

    public static final SystemColor window
    The color rendered for the background of interior regions inside windows.

  - ### windowBorder

    public static final SystemColor windowBorder
    The color rendered for the border around interior regions inside windows.

  - ### windowText

    public static final SystemColor windowText
    The color rendered for text of interior regions inside windows.

  - ### menu

    public static final SystemColor menu
    The color rendered for the background of menus.

  - ### menuText

    public static final SystemColor menuText
    The color rendered for the text of menus.

  - ### text

    public static final SystemColor text
    The color rendered for the background of text control objects, such as textfields and comboboxes.

  - ### textText

    public static final SystemColor textText
    The color rendered for the text of text control objects, such as textfields and comboboxes.

  - ### textHighlight

    public static final SystemColor textHighlight
    The color rendered for the background of selected items, such as in menus, comboboxes, and text.

  - ### textHighlightText

    public static final SystemColor textHighlightText
    The color rendered for the text of selected items, such as in menus, comboboxes, and text.

  - ### textInactiveText

    public static final SystemColor textInactiveText
    The color rendered for the text of inactive items, such as in menus.

  - ### control

    public static final SystemColor control
    The color rendered for the background of control panels and control objects, such as pushbuttons.

  - ### controlText

    public static final SystemColor controlText
    The color rendered for the text of control panels and control objects, such as pushbuttons.

  - ### controlHighlight

    public static final SystemColor controlHighlight
    The color rendered for light areas of 3D control objects, such as pushbuttons. This color is typically derived from the `control` background color to provide a 3D effect.

  - ### controlLtHighlight

    public static final SystemColor controlLtHighlight
    The color rendered for highlight areas of 3D control objects, such as pushbuttons. This color is typically derived from the `control` background color to provide a 3D effect.

  - ### controlShadow

    public static final SystemColor controlShadow
    The color rendered for shadow areas of 3D control objects, such as pushbuttons. This color is typically derived from the `control` background color to provide a 3D effect.

  - ### controlDkShadow

    public static final SystemColor controlDkShadow
    The color rendered for dark shadow areas on 3D control objects, such as pushbuttons. This color is typically derived from the `control` background color to provide a 3D effect.

  - ### scrollbar

    public static final SystemColor scrollbar
    The color rendered for the background of scrollbars.

  - ### info

    public static final SystemColor info
    The color rendered for the background of tooltips or spot help.

  - ### infoText

    public static final SystemColor infoText
    The color rendered for the text of tooltips or spot help.

- ## Method Details

  - ### toString

    public String toString()
    Returns a string representation of this `Color`'s values. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be `null`.
    Overrides:
      `toString` in class `Color`
    Returns:
      a string representation of this `Color`