Java java.awt Color fields, constructors, methods, implement or subclass

Example usage for Java java.awt Color fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.awt Color.

The text is from its open source code.

Field

ColorWHITE
The color white.
ColorlightGray
The color light gray.
ColorLIGHT_GRAY
The color light gray.
Colorgray
The color gray.
ColordarkGray
The color dark gray.
ColorDARK_GRAY
The color dark gray.
ColorBLACK
The color black.
ColorRED
The color red.
ColorPINK
The color pink.
Colororange
The color orange.
ColorYELLOW
The color yellow.
Colorgreen
The color green.
Colormagenta
The color magenta.
Colorcyan
The color cyan.
Colorblue
The color blue.

Constructor

Color(int r, int g, int b)
Creates an opaque sRGB color with the specified red, green, and blue values in the range (0 - 255).
Color(float r, float g, float b)
Creates an opaque sRGB color with the specified red, green, and blue values in the range (0.0 - 1.0).
Color(ColorSpace cspace, float[] components, float alpha)
Creates a color in the specified ColorSpace with the color components specified in the float array and the specified alpha.
Color(int rgba, boolean hasalpha)
Creates an sRGB color with the specified combined RGBA value consisting of the alpha component in bits 24-31, the red component in bits 16-23, the green component in bits 8-15, and the blue component in bits 0-7.
Color(int rgb)
Creates an opaque sRGB color with the specified combined RGB value consisting of the red component in bits 16-23, the green component in bits 8-15, and the blue component in bits 0-7.
Color(int r, int g, int b, int a)
Creates an sRGB color with the specified red, green, blue, and alpha values in the range (0 - 255).
Color(float r, float g, float b, float a)
Creates an sRGB color with the specified red, green, blue, and alpha values in the range (0.0 - 1.0).

Method

Colorbrighter()
Creates a new Color that is a brighter version of this Color .
Colordarker()
Creates a new Color that is a darker version of this Color .
Colordecode(String nm)
Converts a String to an integer and returns the specified opaque Color .
booleanequals(Object obj)
Determines whether another object is equal to this Color .
intgetAlpha()
Returns the alpha component in the range 0-255.
intgetBlue()
Returns the blue component in the range 0-255 in the default sRGB space.
ClassgetClass()
Returns the runtime class of this Object .
ColorgetColor(String nm, Color v)
Finds a color in the system properties.
ColorgetColor(String nm, int v)
Finds a color in the system properties.
ColorgetColor(String nm)
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.
ColorSpacegetColorSpace()
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.
intgetGreen()
Returns the green component in the range 0-255 in the default sRGB space.
ColorgetHSBColor(float h, float s, float b)
Creates a Color object based on the specified values for the HSB color model.
intgetRed()
Returns the red component in the range 0-255 in the default sRGB space.
intgetRGB()
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.
intgetTransparency()
Returns the transparency mode for this Color .
inthashCode()
Computes the hash code for this Color .
intHSBtoRGB(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.
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.
StringtoString()
Returns a string representation of this Color .