Overview
Package
Class
Use
Tree
Deprecated
Index
All Classes
Help
Prev Class
Next Class
Sample
Document
Class java.awt.SystemColor
Inherited members: ShowHide
Deprecated: ShowHide
View: ClientSubclassPackageImplementation
java.awt

Class SystemColor

  • java.lang.Object
    • java.awt.Color
      • java.awt.SystemColor
  • All Implemented Interfaces:
    Paint, Transparency, java.io.Serializable
    public final class SystemColor extends Color implements java.io.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(java.lang.String), Serialized Form
    • Fields 
      Modifier and Type Field and Description
      Ordinary member indicator ACTIVE_CAPTION Reveal DetailHide Detail
      static int ACTIVE_CAPTION
      The array index for the activeCaption system color.
      public static final int ACTIVE_CAPTION
      The array index for the activeCaption system color.
      See Also:
      activeCaption, Constant Field Values
      Ordinary member indicator ACTIVE_CAPTION_BORDER Reveal DetailHide Detail
      static int ACTIVE_CAPTION_BORDER
      The array index for the activeCaptionBorder system color.
      public static final int ACTIVE_CAPTION_BORDER
      The array index for the activeCaptionBorder system color.
      See Also:
      activeCaptionBorder, Constant Field Values
      Ordinary member indicator ACTIVE_CAPTION_TEXT Reveal DetailHide Detail
      static int ACTIVE_CAPTION_TEXT
      The array index for the activeCaptionText system color.
      public static final int ACTIVE_CAPTION_TEXT
      The array index for the activeCaptionText system color.
      See Also:
      activeCaptionText, Constant Field Values
      Ordinary member indicator activeCaption Reveal DetailHide Detail
      static SystemColor activeCaption
      The color rendered for the window-title background of the currently active window.
      public static final SystemColor activeCaption
      The color rendered for the window-title background of the currently active window.
      Ordinary member indicator activeCaptionBorder Reveal DetailHide Detail
      static SystemColor activeCaptionBorder
      The color rendered for the border around the currently active window.
      public static final SystemColor activeCaptionBorder
      The color rendered for the border around the currently active window.
      Ordinary member indicator activeCaptionText Reveal DetailHide Detail
      static SystemColor activeCaptionText
      The color rendered for the window-title text of the currently active window.
      public static final SystemColor activeCaptionText
      The color rendered for the window-title text of the currently active window.
      Inherited member indicator BITMASK Reveal DetailHide Detail
      static 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.
      public 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.
      See Also:
      Constant Field Values
      Inherited member indicator black Reveal DetailHide Detail
      static Color black
      The color black.
      public static final Color black
      The color black. In the default sRGB space.
      Inherited member indicator BLACK Reveal DetailHide Detail
      static Color BLACK
      The color black.
      public static final Color BLACK
      The color black. In the default sRGB space.
      Since:
      1.4
      Inherited member indicator blue Reveal DetailHide Detail
      static Color blue
      The color blue.
      public static final Color blue
      The color blue. In the default sRGB space.
      Inherited member indicator BLUE Reveal DetailHide Detail
      static Color BLUE
      The color blue.
      public static final Color BLUE
      The color blue. In the default sRGB space.
      Since:
      1.4
      Ordinary member indicator control Reveal DetailHide Detail
      static SystemColor control
      The color rendered for the background of control panels and control objects, such as pushbuttons.
      public static final SystemColor control
      The color rendered for the background of control panels and control objects, such as pushbuttons.
      Ordinary member indicator CONTROL Reveal DetailHide Detail
      static int CONTROL
      The array index for the control system color.
      public static final int CONTROL
      The array index for the control system color.
      See Also:
      control, Constant Field Values
      Ordinary member indicator CONTROL_DK_SHADOW Reveal DetailHide Detail
      static int CONTROL_DK_SHADOW
      The array index for the controlDkShadow system color.
      public static final int CONTROL_DK_SHADOW
      The array index for the controlDkShadow system color.
      See Also:
      controlDkShadow, Constant Field Values
      Ordinary member indicator CONTROL_HIGHLIGHT Reveal DetailHide Detail
      static int CONTROL_HIGHLIGHT
      The array index for the controlHighlight system color.
      public static final int CONTROL_HIGHLIGHT
      The array index for the controlHighlight system color.
      See Also:
      controlHighlight, Constant Field Values
      Ordinary member indicator CONTROL_LT_HIGHLIGHT Reveal DetailHide Detail
      static int CONTROL_LT_HIGHLIGHT
      The array index for the controlLtHighlight system color.
      public static final int CONTROL_LT_HIGHLIGHT
      The array index for the controlLtHighlight system color.
      See Also:
      controlLtHighlight, Constant Field Values
      Ordinary member indicator CONTROL_SHADOW Reveal DetailHide Detail
      static int CONTROL_SHADOW
      The array index for the controlShadow system color.
      public static final int CONTROL_SHADOW
      The array index for the controlShadow system color.
      See Also:
      controlShadow, Constant Field Values
      Ordinary member indicator CONTROL_TEXT Reveal DetailHide Detail
      static int CONTROL_TEXT
      The array index for the controlText system color.
      public static final int CONTROL_TEXT
      The array index for the controlText system color.
      See Also:
      controlText, Constant Field Values
      Ordinary member indicator controlDkShadow Reveal DetailHide Detail
      static SystemColor controlDkShadow
      The color rendered for dark shadow areas on 3D control objects, such as pushbuttons.
      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.
      Ordinary member indicator controlHighlight Reveal DetailHide Detail
      static SystemColor controlHighlight
      The color rendered for light areas of 3D control objects, such as pushbuttons.
      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.
      Ordinary member indicator controlLtHighlight Reveal DetailHide Detail
      static SystemColor controlLtHighlight
      The color rendered for highlight areas of 3D control objects, such as pushbuttons.
      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.
      Ordinary member indicator controlShadow Reveal DetailHide Detail
      static SystemColor controlShadow
      The color rendered for shadow areas of 3D control objects, such as pushbuttons.
      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.
      Ordinary member indicator controlText Reveal DetailHide Detail
      static SystemColor controlText
      The color rendered for the text of control panels and control objects, such as pushbuttons.
      public static final SystemColor controlText
      The color rendered for the text of control panels and control objects, such as pushbuttons.
      Inherited member indicator cyan Reveal DetailHide Detail
      static Color cyan
      The color cyan.
      public static final Color cyan
      The color cyan. In the default sRGB space.
      Inherited member indicator CYAN Reveal DetailHide Detail
      static Color CYAN
      The color cyan.
      public static final Color CYAN
      The color cyan. In the default sRGB space.
      Since:
      1.4
      Inherited member indicator DARK_GRAY Reveal DetailHide Detail
      static Color DARK_GRAY
      The color dark gray.
      public static final Color DARK_GRAY
      The color dark gray. In the default sRGB space.
      Since:
      1.4
      Inherited member indicator darkGray Reveal DetailHide Detail
      static Color darkGray
      The color dark gray.
      public static final Color darkGray
      The color dark gray. In the default sRGB space.
      Ordinary member indicator desktop Reveal DetailHide Detail
      static SystemColor desktop
      The color rendered for the background of the desktop.
      public static final SystemColor desktop
      The color rendered for the background of the desktop.
      Ordinary member indicator DESKTOP Reveal DetailHide Detail
      static int DESKTOP
      The array index for the desktop system color.
      public static final int DESKTOP
      The array index for the desktop system color.
      See Also:
      desktop, Constant Field Values
      Inherited member indicator gray Reveal DetailHide Detail
      static Color gray
      The color gray.
      public static final Color gray
      The color gray. In the default sRGB space.
      Inherited member indicator GRAY Reveal DetailHide Detail
      static Color GRAY
      The color gray.
      public static final Color GRAY
      The color gray. In the default sRGB space.
      Since:
      1.4
      Inherited member indicator green Reveal DetailHide Detail
      static Color green
      The color green.
      public static final Color green
      The color green. In the default sRGB space.
      Inherited member indicator GREEN Reveal DetailHide Detail
      static Color GREEN
      The color green.
      public static final Color GREEN
      The color green. In the default sRGB space.
      Since:
      1.4
      Ordinary member indicator INACTIVE_CAPTION Reveal DetailHide Detail
      static int INACTIVE_CAPTION
      The array index for the inactiveCaption system color.
      public static final int INACTIVE_CAPTION
      The array index for the inactiveCaption system color.
      See Also:
      inactiveCaption, Constant Field Values
      Ordinary member indicator INACTIVE_CAPTION_BORDER Reveal DetailHide Detail
      static int INACTIVE_CAPTION_BORDER
      The array index for the inactiveCaptionBorder system color.
      public static final int INACTIVE_CAPTION_BORDER
      The array index for the inactiveCaptionBorder system color.
      See Also:
      inactiveCaptionBorder, Constant Field Values
      Ordinary member indicator INACTIVE_CAPTION_TEXT Reveal DetailHide Detail
      static int INACTIVE_CAPTION_TEXT
      The array index for the inactiveCaptionText system color.
      public static final int INACTIVE_CAPTION_TEXT
      The array index for the inactiveCaptionText system color.
      See Also:
      inactiveCaptionText, Constant Field Values
      Ordinary member indicator inactiveCaption Reveal DetailHide Detail
      static SystemColor inactiveCaption
      The color rendered for the window-title background of inactive windows.
      public static final SystemColor inactiveCaption
      The color rendered for the window-title background of inactive windows.
      Ordinary member indicator inactiveCaptionBorder Reveal DetailHide Detail
      static SystemColor inactiveCaptionBorder
      The color rendered for the border around inactive windows.
      public static final SystemColor inactiveCaptionBorder
      The color rendered for the border around inactive windows.
      Ordinary member indicator inactiveCaptionText Reveal DetailHide Detail
      static SystemColor inactiveCaptionText
      The color rendered for the window-title text of inactive windows.
      public static final SystemColor inactiveCaptionText
      The color rendered for the window-title text of inactive windows.
      Ordinary member indicator info Reveal DetailHide Detail
      static SystemColor info
      The color rendered for the background of tooltips or spot help.
      public static final SystemColor info
      The color rendered for the background of tooltips or spot help.
      Ordinary member indicator INFO Reveal DetailHide Detail
      static int INFO
      The array index for the info system color.
      public static final int INFO
      The array index for the info system color.
      See Also:
      info, Constant Field Values
      Ordinary member indicator INFO_TEXT Reveal DetailHide Detail
      static int INFO_TEXT
      The array index for the infoText system color.
      public static final int INFO_TEXT
      The array index for the infoText system color.
      See Also:
      infoText, Constant Field Values
      Ordinary member indicator infoText Reveal DetailHide Detail
      static SystemColor infoText
      The color rendered for the text of tooltips or spot help.
      public static final SystemColor infoText
      The color rendered for the text of tooltips or spot help.
      Inherited member indicator LIGHT_GRAY Reveal DetailHide Detail
      static Color LIGHT_GRAY
      The color light gray.
      public static final Color LIGHT_GRAY
      The color light gray. In the default sRGB space.
      Since:
      1.4
      Inherited member indicator lightGray Reveal DetailHide Detail
      static Color lightGray
      The color light gray.
      public static final Color lightGray
      The color light gray. In the default sRGB space.
      Inherited member indicator magenta Reveal DetailHide Detail
      static Color magenta
      The color magenta.
      public static final Color magenta
      The color magenta. In the default sRGB space.
      Inherited member indicator MAGENTA Reveal DetailHide Detail
      static Color MAGENTA
      The color magenta.
      public static final Color MAGENTA
      The color magenta. In the default sRGB space.
      Since:
      1.4
      Ordinary member indicator menu Reveal DetailHide Detail
      static SystemColor menu
      The color rendered for the background of menus.
      public static final SystemColor menu
      The color rendered for the background of menus.
      Ordinary member indicator MENU Reveal DetailHide Detail
      static int MENU
      The array index for the menu system color.
      public static final int MENU
      The array index for the menu system color.
      See Also:
      menu, Constant Field Values
      Ordinary member indicator MENU_TEXT Reveal DetailHide Detail
      static int MENU_TEXT
      The array index for the menuText system color.
      public static final int MENU_TEXT
      The array index for the menuText system color.
      See Also:
      menuText, Constant Field Values
      Ordinary member indicator menuText Reveal DetailHide Detail
      static SystemColor menuText
      The color rendered for the text of menus.
      public static final SystemColor menuText
      The color rendered for the text of menus.
      Ordinary member indicator NUM_COLORS Reveal DetailHide Detail
      static int NUM_COLORS
      The number of system colors in the array.
      public static final int NUM_COLORS
      The number of system colors in the array.
      See Also:
      Constant Field Values
      Inherited member indicator OPAQUE Reveal DetailHide Detail
      static int OPAQUE
      Represents image data that is guaranteed to be completely opaque, meaning that all pixels have an alpha value of 1.0.
      public 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.
      See Also:
      Constant Field Values
      Inherited member indicator orange Reveal DetailHide Detail
      static Color orange
      The color orange.
      public static final Color orange
      The color orange. In the default sRGB space.
      Inherited member indicator ORANGE Reveal DetailHide Detail
      static Color ORANGE
      The color orange.
      public static final Color ORANGE
      The color orange. In the default sRGB space.
      Since:
      1.4
      Inherited member indicator pink Reveal DetailHide Detail
      static Color pink
      The color pink.
      public static final Color pink
      The color pink. In the default sRGB space.
      Inherited member indicator PINK Reveal DetailHide Detail
      static Color PINK
      The color pink.
      public static final Color PINK
      The color pink. In the default sRGB space.
      Since:
      1.4
      Inherited member indicator red Reveal DetailHide Detail
      static Color red
      The color red.
      public static final Color red
      The color red. In the default sRGB space.
      Inherited member indicator RED Reveal DetailHide Detail
      static Color RED
      The color red.
      public static final Color RED
      The color red. In the default sRGB space.
      Since:
      1.4
      Ordinary member indicator scrollbar Reveal DetailHide Detail
      static SystemColor scrollbar
      The color rendered for the background of scrollbars.
      public static final SystemColor scrollbar
      The color rendered for the background of scrollbars.
      Ordinary member indicator SCROLLBAR Reveal DetailHide Detail
      static int SCROLLBAR
      The array index for the scrollbar system color.
      public static final int SCROLLBAR
      The array index for the scrollbar system color.
      See Also:
      scrollbar, Constant Field Values
      Ordinary member indicator text Reveal DetailHide Detail
      static SystemColor text
      The color rendered for the background of text control objects, such as textfields and comboboxes.
      public static final SystemColor text
      The color rendered for the background of text control objects, such as textfields and comboboxes.
      Ordinary member indicator TEXT Reveal DetailHide Detail
      static int TEXT
      The array index for the text system color.
      public static final int TEXT
      The array index for the text system color.
      See Also:
      text, Constant Field Values
      Ordinary member indicator TEXT_HIGHLIGHT Reveal DetailHide Detail
      static int TEXT_HIGHLIGHT
      The array index for the textHighlight system color.
      public static final int TEXT_HIGHLIGHT
      The array index for the textHighlight system color.
      See Also:
      textHighlight, Constant Field Values
      Ordinary member indicator TEXT_HIGHLIGHT_TEXT Reveal DetailHide Detail
      static int TEXT_HIGHLIGHT_TEXT
      The array index for the textHighlightText system color.
      public static final int TEXT_HIGHLIGHT_TEXT
      The array index for the textHighlightText system color.
      See Also:
      textHighlightText, Constant Field Values
      Ordinary member indicator TEXT_INACTIVE_TEXT Reveal DetailHide Detail
      static int TEXT_INACTIVE_TEXT
      The array index for the textInactiveText system color.
      public static final int TEXT_INACTIVE_TEXT
      The array index for the textInactiveText system color.
      See Also:
      textInactiveText, Constant Field Values
      Ordinary member indicator TEXT_TEXT Reveal DetailHide Detail
      static int TEXT_TEXT
      The array index for the textText system color.
      public static final int TEXT_TEXT
      The array index for the textText system color.
      See Also:
      textText, Constant Field Values
      Ordinary member indicator textHighlight Reveal DetailHide Detail
      static SystemColor textHighlight
      The color rendered for the background of selected items, such as in menus, comboboxes, and text.
      public static final SystemColor textHighlight
      The color rendered for the background of selected items, such as in menus, comboboxes, and text.
      Ordinary member indicator textHighlightText Reveal DetailHide Detail
      static SystemColor textHighlightText
      The color rendered for the text of selected items, such as in menus, comboboxes, and text.
      public static final SystemColor textHighlightText
      The color rendered for the text of selected items, such as in menus, comboboxes, and text.
      Ordinary member indicator textInactiveText Reveal DetailHide Detail
      static SystemColor textInactiveText
      The color rendered for the text of inactive items, such as in menus.
      public static final SystemColor textInactiveText
      The color rendered for the text of inactive items, such as in menus.
      Ordinary member indicator textText Reveal DetailHide Detail
      static SystemColor textText
      The color rendered for the text of text control objects, such as textfields and comboboxes.
      public static final SystemColor textText
      The color rendered for the text of text control objects, such as textfields and comboboxes.
      Inherited member indicator TRANSLUCENT Reveal DetailHide Detail
      static int TRANSLUCENT
      Represents image data that contains or might contain arbitrary alpha values between and including 0.0 and 1.0.
      public static final int TRANSLUCENT
      Represents image data that contains or might contain arbitrary alpha values between and including 0.0 and 1.0.
      See Also:
      Constant Field Values
      Inherited member indicator white Reveal DetailHide Detail
      static Color white
      The color white.
      public static final Color white
      The color white. In the default sRGB space.
      Inherited member indicator WHITE Reveal DetailHide Detail
      static Color WHITE
      The color white.
      public static final Color WHITE
      The color white. In the default sRGB space.
      Since:
      1.4
      Ordinary member indicator window Reveal DetailHide Detail
      static SystemColor window
      The color rendered for the background of interior regions inside windows.
      public static final SystemColor window
      The color rendered for the background of interior regions inside windows.
      Ordinary member indicator WINDOW Reveal DetailHide Detail
      static int WINDOW
      The array index for the window system color.
      public static final int WINDOW
      The array index for the window system color.
      See Also:
      window, Constant Field Values
      Ordinary member indicator WINDOW_BORDER Reveal DetailHide Detail
      static int WINDOW_BORDER
      The array index for the windowBorder system color.
      public static final int WINDOW_BORDER
      The array index for the windowBorder system color.
      See Also:
      windowBorder, Constant Field Values
      Ordinary member indicator WINDOW_TEXT Reveal DetailHide Detail
      static int WINDOW_TEXT
      The array index for the windowText system color.
      public static final int WINDOW_TEXT
      The array index for the windowText system color.
      See Also:
      windowText, Constant Field Values
      Ordinary member indicator windowBorder Reveal DetailHide Detail
      static SystemColor windowBorder
      The color rendered for the border around interior regions inside windows.
      public static final SystemColor windowBorder
      The color rendered for the border around interior regions inside windows.
      Ordinary member indicator windowText Reveal DetailHide Detail
      static SystemColor windowText
      The color rendered for text of interior regions inside windows.
      public static final SystemColor windowText
      The color rendered for text of interior regions inside windows.
      Inherited member indicator yellow Reveal DetailHide Detail
      static Color yellow
      The color yellow.
      public static final Color yellow
      The color yellow. In the default sRGB space.
      Inherited member indicator YELLOW Reveal DetailHide Detail
      static Color YELLOW
      The color yellow.
      public static final Color YELLOW
      The color yellow. In the default sRGB space.
      Since:
      1.4
    • Static Methods 
      Modifier and Type Static Method and Description
      Inherited member indicator decode Reveal DetailHide Detail
      static Color decode(java.lang.String nm)
      Converts a String to an integer and returns the specified opaque Color.
      public static Color decode(java.lang.String nm) throws java.lang.NumberFormatException
      Description copied from class: Color
      Converts a String to an integer and returns the specified opaque Color. This method handles string formats that are used to represent octal and hexadecimal numbers.
      Parameters:
      nm - a String that represents an opaque color as a 24-bit integer
      Returns:
      the new Color object.
      Throws:
      java.lang.NumberFormatException - if the specified string cannot be interpreted as a decimal, octal, or hexadecimal integer.
      Since:
      JDK1.1
      See Also:
      Integer.decode(java.lang.String)
      Inherited member indicator getColor Reveal DetailHide Detail
      static Color getColor(java.lang.String nm)
      Finds a color in the system properties.
      public static Color getColor(java.lang.String nm)
      Description copied from class: Color
      Finds a color in the system properties.

      The argument is treated as the name of a system property to be obtained. The string value of this property is then interpreted as an integer which is then converted to a Color object.

      If the specified property is not found or could not be parsed as an integer then null is returned.

      Parameters:
      nm - the name of the color property
      Returns:
      the Color converted from the system property.
      Since:
      JDK1.0
      See Also:
      System.getProperty(java.lang.String), Integer.getInteger(java.lang.String), Color.Color(int)
      Inherited member indicator getColor Reveal DetailHide Detail
      static Color getColor(java.lang.String nm, Color v)
      Finds a color in the system properties.
      public static Color getColor(java.lang.String nm, Color v)
      Description copied from class: Color
      Finds a color in the system properties.

      The first argument is treated as the name of a system property to be obtained. The string value of this property is then interpreted as an integer which is then converted to a Color object.

      If the specified property is not found or cannot be parsed as an integer then the Color specified by the second argument is returned instead.

      Parameters:
      nm - the name of the color property
      v - the default Color
      Returns:
      the Color converted from the system property, or the specified Color.
      Since:
      JDK1.0
      See Also:
      System.getProperty(java.lang.String), Integer.getInteger(java.lang.String), Color.Color(int)
      Inherited member indicator getColor Reveal DetailHide Detail
      static Color getColor(java.lang.String nm, int v)
      Finds a color in the system properties.
      public static Color getColor(java.lang.String nm, int v)
      Description copied from class: Color
      Finds a color in the system properties.

      The first argument is treated as the name of a system property to be obtained. The string value of this property is then interpreted as an integer which is then converted to a Color object.

      If the specified property is not found or could not be parsed as an integer then the integer value v is used instead, and is converted to a Color object.

      Parameters:
      nm - the name of the color property
      v - the default color value, as an integer
      Returns:
      the Color converted from the system property or the Color converted from the specified integer.
      Since:
      JDK1.0
      See Also:
      System.getProperty(java.lang.String), Integer.getInteger(java.lang.String), Color.Color(int)
      Inherited member indicator getHSBColor Reveal DetailHide Detail
      static Color getHSBColor(float h, float s, float b)
      Creates a Color object based on the specified values for the HSB color model.
      public static Color getHSBColor(float h, float s, float b)
      Description copied from class: Color
      Creates a Color object based on the specified values for the HSB color model.

      The s and b components should be floating-point values between zero and one (numbers in the range 0.0-1.0). The h component can be any floating-point number. The floor of this number is subtracted from it to create a fraction between 0 and 1. This fractional number is then multiplied by 360 to produce the hue angle in the HSB color model.

      Parameters:
      h - the hue component
      s - the saturation of the color
      b - the brightness of the color
      Returns:
      a Color object with the specified hue, saturation, and brightness.
      Since:
      JDK1.0
      Inherited member indicator HSBtoRGB Reveal DetailHide Detail
      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.
      public static int HSBtoRGB(float hue, float saturation, float brightness)
      Description copied from class: Color
      Converts the components of a color, as specified by the HSB model, to an equivalent set of values for the default RGB model.

      The saturation and brightness components should be floating-point values between zero and one (numbers in the range 0.0-1.0). The hue component can be any floating-point number. The floor of this number is subtracted from it to create a fraction between 0 and 1. This fractional number is then multiplied by 360 to produce the hue angle in the HSB color model.

      The integer that is returned by HSBtoRGB encodes the value of a color in bits 0-23 of an integer value that is the same format used by the method getRGB. This integer can be supplied as an argument to the Color constructor that takes a single integer argument.

      Parameters:
      hue - the hue component of the color
      saturation - the saturation of the color
      brightness - the brightness of the color
      Returns:
      the RGB value of the color with the indicated hue, saturation, and brightness.
      Since:
      JDK1.0
      See Also:
      Color.getRGB(), Color.Color(int), ColorModel.getRGBdefault()
      Inherited member indicator RGBtoHSB Reveal DetailHide Detail
      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.
      public static float[] RGBtoHSB(int r, int g, int b, float[] hsbvals)
      Description copied from class: Color
      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.

      If the hsbvals argument is null, then a new array is allocated to return the result. Otherwise, the method returns the array hsbvals, with the values put into that array.

      Parameters:
      r - the red component of the color
      g - the green component of the color
      b - the blue component of the color
      hsbvals - the array used to return the three HSB values, or null
      Returns:
      an array of three elements containing the hue, saturation, and brightness (in that order), of the color with the indicated red, green, and blue components.
      Since:
      JDK1.0
      See Also:
      Color.getRGB(), Color.Color(int), ColorModel.getRGBdefault()
    • Methods 
      Modifier and Type Method and Description
      Inherited member indicator brighter Reveal DetailHide Detail
      Color brighter()
      Creates a new Color that is a brighter version of this Color.
      public Color brighter()
      Description copied from class: Color
      Creates a new Color that is a brighter version of this Color.

      This method applies an arbitrary scale factor to each of the three RGB components of this Color to create a brighter version of this Color. The alpha value is preserved. Although brighter and darker are inverse operations, the results of a series of invocations of these two methods might be inconsistent because of rounding errors.

      Returns:
      a new Color object that is a brighter version of this Color with the same alpha value.
      Since:
      JDK1.0
      See Also:
      Color.darker()
      Inherited member indicator createContext Reveal DetailHide Detail
      PaintContext createContext(java.awt.image.ColorModel cm, Rectangle r, java.awt.geom.Rectangle2D r2d, java.awt.geom.AffineTransform xform, RenderingHints hints)
      Creates and returns a PaintContext used to generate a solid color field pattern.
      public PaintContext createContext(java.awt.image.ColorModel cm, Rectangle r, java.awt.geom.Rectangle2D r2d, java.awt.geom.AffineTransform xform, RenderingHints hints)
      Description copied from class: Color
      Creates and returns a PaintContext used to generate a solid color field pattern. See the specification of the method in the Paint interface for information on null parameter handling.
      Specified by:
      createContext in interface Paint
      Parameters:
      cm - the preferred ColorModel which represents the most convenient format for the caller to receive the pixel data, or null if there is no preference.
      r - the device space bounding box of the graphics primitive being rendered.
      r2d - the user space bounding box of the graphics primitive being rendered.
      xform - the AffineTransform from user space into device space.
      hints - the set of hints that the context object can use to choose between rendering alternatives.
      Returns:
      the PaintContext for generating color patterns.
      See Also:
      Paint, PaintContext, ColorModel, Rectangle, Rectangle2D, AffineTransform, RenderingHints
      Inherited member indicator darker Reveal DetailHide Detail
      Color darker()
      Creates a new Color that is a darker version of this Color.
      public Color darker()
      Description copied from class: Color
      Creates a new Color that is a darker version of this Color.

      This method applies an arbitrary scale factor to each of the three RGB components of this Color to create a darker version of this Color. The alpha value is preserved. Although brighter and darker are inverse operations, the results of a series of invocations of these two methods might be inconsistent because of rounding errors.

      Returns:
      a new Color object that is a darker version of this Color with the same alpha value.
      Since:
      JDK1.0
      See Also:
      Color.brighter()
      Inherited member indicator equals Reveal DetailHide Detail
      boolean equals(java.lang.Object obj)
      Determines whether another object is equal to this Color.
      public boolean equals(java.lang.Object obj)
      Description copied from class: Color
      Determines whether another object is equal to this Color.

      The result is true if and only if the argument is not null and is a Color object that has the same red, green, blue, and alpha values as this object.

      Overrides:
      equals in class java.lang.Object
      Parameters:
      obj - the object to test for equality with this Color
      Returns:
      true if the objects are the same; false otherwise.
      Since:
      JDK1.0
      See Also:
      Object.hashCode(), HashMap
      Inherited member indicator getAlpha Reveal DetailHide Detail
      int getAlpha()
      Returns the alpha component in the range 0-255.
      public int getAlpha()
      Description copied from class: Color
      Returns the alpha component in the range 0-255.
      Returns:
      the alpha component.
      See Also:
      Color.getRGB()
      Inherited member indicator getBlue Reveal DetailHide Detail
      int getBlue()
      Returns the blue component in the range 0-255 in the default sRGB space.
      public int getBlue()
      Description copied from class: Color
      Returns the blue component in the range 0-255 in the default sRGB space.
      Returns:
      the blue component.
      See Also:
      Color.getRGB()
      Inherited member indicator getColorComponents Reveal DetailHide Detail
      float[] getColorComponents(java.awt.color.ColorSpace cspace, float[] compArray)
      Returns a float array containing only the color components of the Color in the ColorSpace specified by the cspace parameter.
      public float[] getColorComponents(java.awt.color.ColorSpace cspace, float[] compArray)
      Description copied from class: Color
      Returns a float array containing only the color components of the Color in the ColorSpace specified by the cspace parameter. If compArray is null, an array with length equal to the number of components in cspace is created for the return value. Otherwise, compArray must have at least this length, and it is filled in with the components and returned.
      Parameters:
      cspace - a specified ColorSpace
      compArray - an array that this method fills with the color components of this Color in the specified ColorSpace
      Returns:
      the color components in a float array.
      Inherited member indicator getColorComponents Reveal DetailHide Detail
      float[] getColorComponents(float[] compArray)
      Returns a float array containing only the color components of the Color, in the ColorSpace of the Color.
      public float[] getColorComponents(float[] compArray)
      Description copied from class: Color
      Returns a float array containing only the color components of the Color, in the ColorSpace of the Color. If compArray is null, an array with length equal to the number of components in the associated ColorSpace is created for the return value. Otherwise, compArray must have at least this length and it is filled in with the components and returned.
      Parameters:
      compArray - an array that this method fills with the color components of this Color in its ColorSpace and returns
      Returns:
      the color components in a float array.
      Inherited member indicator getColorSpace Reveal DetailHide Detail
      java.awt.color.ColorSpace getColorSpace()
      Returns the ColorSpace of this Color.
      public java.awt.color.ColorSpace getColorSpace()
      Description copied from class: Color
      Returns the ColorSpace of this Color.
      Returns:
      this Color object's ColorSpace.
      Inherited member indicator getComponents Reveal DetailHide Detail
      float[] getComponents(java.awt.color.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.
      public float[] getComponents(java.awt.color.ColorSpace cspace, float[] compArray)
      Description copied from class: Color
      Returns a float array containing the color and alpha components of the Color, in the ColorSpace specified by the cspace parameter. If compArray is null, an array with length equal to the number of components in cspace plus one is created for the return value. Otherwise, compArray must have at least this length, and it is filled in with the components and returned.
      Parameters:
      cspace - a specified ColorSpace
      compArray - an array that this method fills with the color and alpha components of this Color in the specified ColorSpace and returns
      Returns:
      the color and alpha components in a float array.
      Inherited member indicator getComponents Reveal DetailHide Detail
      float[] getComponents(float[] compArray)
      Returns a float array containing the color and alpha components of the Color, in the ColorSpace of the Color.
      public float[] getComponents(float[] compArray)
      Description copied from class: Color
      Returns a float array containing the color and alpha components of the Color, in the ColorSpace of the Color. If compArray is null, an array with length equal to the number of components in the associated ColorSpace plus one is created for the return value. Otherwise, compArray must have at least this length and it is filled in with the components and returned.
      Parameters:
      compArray - an array that this method fills with the color and alpha components of this Color in its ColorSpace and returns
      Returns:
      the color and alpha components in a float array.
      Inherited member indicator getGreen Reveal DetailHide Detail
      int getGreen()
      Returns the green component in the range 0-255 in the default sRGB space.
      public int getGreen()
      Description copied from class: Color
      Returns the green component in the range 0-255 in the default sRGB space.
      Returns:
      the green component.
      See Also:
      Color.getRGB()
      Inherited member indicator getRed Reveal DetailHide Detail
      int getRed()
      Returns the red component in the range 0-255 in the default sRGB space.
      public int getRed()
      Description copied from class: Color
      Returns the red component in the range 0-255 in the default sRGB space.
      Returns:
      the red component.
      See Also:
      Color.getRGB()
      Inherited member indicator getRGB Reveal DetailHide Detail
      int getRGB()
      Returns the RGB value representing the color in the default sRGB ColorModel.
      public int getRGB()
      Description copied from class: Color
      Returns the RGB value representing the color in the default sRGB ColorModel. (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are blue).
      Returns:
      the RGB value of the color in the default sRGB ColorModel.
      Since:
      JDK1.0
      See Also:
      ColorModel.getRGBdefault(), Color.getRed(), Color.getGreen(), Color.getBlue()
      Inherited member indicator getRGBColorComponents Reveal DetailHide Detail
      float[] getRGBColorComponents(float[] compArray)
      Returns a float array containing only the color components of the Color, in the default sRGB color space.
      public float[] getRGBColorComponents(float[] compArray)
      Description copied from class: Color
      Returns a float array containing only the color components of the Color, in the default sRGB color space. If compArray is null, an array of length 3 is created for the return value. Otherwise, compArray must have length 3 or greater, and it is filled in with the components and returned.
      Parameters:
      compArray - an array that this method fills with color components and returns
      Returns:
      the RGB components in a float array.
      Inherited member indicator getRGBComponents Reveal DetailHide Detail
      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.
      public float[] getRGBComponents(float[] compArray)
      Description copied from class: Color
      Returns a float array containing the color and alpha components of the Color, as represented in the default sRGB color space. If compArray is null, an array of length 4 is created for the return value. Otherwise, compArray must have length 4 or greater, and it is filled in with the components and returned.
      Parameters:
      compArray - an array that this method fills with color and alpha components and returns
      Returns:
      the RGBA components in a float array.
      Inherited member indicator getTransparency Reveal DetailHide Detail
      int getTransparency()
      Returns the transparency mode for this Color.
      public int getTransparency()
      Description copied from class: Color
      Returns the transparency mode for this Color. This is required to implement the Paint interface.
      Specified by:
      getTransparency in interface Transparency
      Returns:
      this Color object's transparency mode.
      See Also:
      Paint, Transparency, Color.createContext(java.awt.image.ColorModel, java.awt.Rectangle, java.awt.geom.Rectangle2D, java.awt.geom.AffineTransform, java.awt.RenderingHints)
      Inherited member indicator hashCode Reveal DetailHide Detail
      int hashCode()
      Computes the hash code for this Color.
      public int hashCode()
      Description copied from class: Color
      Computes the hash code for this Color.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      a hash code value for this object.
      Since:
      JDK1.0
      See Also:
      Object.equals(java.lang.Object), System.identityHashCode(java.lang.Object)
      Overridden member indicator toString Reveal DetailHide Detail
      java.lang.String toString()
      Returns a string representation of this Color's values.
      public java.lang.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
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
This document was created by Dulcet from the OpenJDK sources. Copyright © 1993, 2012 Oracle and/or its affiliates. All rights reserved.

SourceForge