Uses of Class
java.awt.Color
-
Packages that use Color Package Description java.awt Contains all of the classes for creating user interfaces and for painting graphics and images. -
-
Uses of Color in java.awt
Subclasses of Color in java.awt Modifier and Type Class and Description class
SystemColor
A class to encapsulate symbolic colors representing the color of native GUI objects on a system.Fields in java.awt declared as Color Modifier and Type Field and Description static Color
Color. black
The color black.static Color
Color. BLACK
The color black.static Color
Color. blue
The color blue.static Color
Color. BLUE
The color blue.static Color
Color. cyan
The color cyan.static Color
Color. CYAN
The color cyan.static Color
Color. DARK_GRAY
The color dark gray.static Color
Color. darkGray
The color dark gray.static Color
Color. gray
The color gray.static Color
Color. GRAY
The color gray.static Color
Color. green
The color green.static Color
Color. GREEN
The color green.static Color
Color. LIGHT_GRAY
The color light gray.static Color
Color. lightGray
The color light gray.static Color
Color. magenta
The color magenta.static Color
Color. MAGENTA
The color magenta.static Color
Color. orange
The color orange.static Color
Color. ORANGE
The color orange.static Color
Color. pink
The color pink.static Color
Color. PINK
The color pink.static Color
Color. red
The color red.static Color
Color. RED
The color red.static Color
Color. white
The color white.static Color
Color. WHITE
The color white.static Color
Color. yellow
The color yellow.static Color
Color. YELLOW
The color yellow.Methods in java.awt that return Color Modifier and Type Method and Description Color
Color. brighter()
Creates a newColor
that is a brighter version of thisColor
.Color
Color. darker()
Creates a newColor
that is a darker version of thisColor
.static Color
Color. decode(java.lang.String nm)
Converts aString
to an integer and returns the specified opaqueColor
.Color
Window. getBackground()
Gets the background color of this window.Color
TextComponent. getBackground()
Gets the background color of this text component.Color
MenuComponent.AccessibleAWTMenuComponent. getBackground()
Gets the background color of this object.Color
List.AccessibleAWTList.AccessibleAWTListChild. getBackground()
Get the background color of this object.abstract Color
Graphics2D. getBackground()
Returns the background color used for clearing a region.Color
Component. getBackground()
Gets the background color of this component.Color
Component.AccessibleAWTComponent. getBackground()
Gets the background color of this object.abstract Color
Graphics. getColor()
Gets this graphics context's current color.static Color
Color. getColor(java.lang.String nm)
Finds a color in the system properties.static Color
Color. getColor(java.lang.String nm, Color v)
Finds a color in the system properties.static Color
Color. getColor(java.lang.String nm, int v)
Finds a color in the system properties.Color
GradientPaint. getColor1()
Returns the color C1 anchored by the point P1.Color
GradientPaint. getColor2()
Returns the color C2 anchored by the point P2.Color[]
MultipleGradientPaint. getColors()
Returns a copy of the array of colors used by this gradient.Color
MenuComponent.AccessibleAWTMenuComponent. getForeground()
Gets the foreground color of this object.Color
List.AccessibleAWTList.AccessibleAWTListChild. getForeground()
Get the foreground color of this object.Color
Component. getForeground()
Gets the foreground color of this component.Color
Component.AccessibleAWTComponent. getForeground()
Gets the foreground color of this object.static Color
Color. getHSBColor(float h, float s, float b)
Creates aColor
object based on the specified values for the HSB color model.Color
Robot. getPixelColor(int x, int y)
Returns the color of a pixel at the given screen coordinates.Methods in java.awt with parameters of type Color Modifier and Type Method and Description abstract boolean
Graphics. drawImage(Image img, int x, int y, Color bgcolor, java.awt.image.ImageObserver observer)
Draws as much of the specified image as is currently available.abstract boolean
Graphics. drawImage(Image img, int x, int y, int width, int height, Color bgcolor, java.awt.image.ImageObserver observer)
Draws as much of the specified image as has already been scaled to fit inside the specified rectangle.abstract boolean
Graphics. drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, java.awt.image.ImageObserver observer)
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface.static Color
Color. getColor(java.lang.String nm, Color v)
Finds a color in the system properties.void
Window. setBackground(Color bgColor)
Sets the background color of this window.void
TextComponent. setBackground(Color c)
Sets the background color of this text component.void
MenuComponent.AccessibleAWTMenuComponent. setBackground(Color c)
Sets the background color of this object.void
List.AccessibleAWTList.AccessibleAWTListChild. setBackground(Color c)
Set the background color of this object.abstract void
Graphics2D. setBackground(Color color)
Sets the background color for theGraphics2D
context.void
Frame. setBackground(Color bgColor)
Sets the background color of this window.void
Dialog. setBackground(Color bgColor)
Sets the background color of this window.void
Component. setBackground(Color c)
Sets the background color of this component.void
Component.AccessibleAWTComponent. setBackground(Color c)
Sets the background color of this object.abstract void
Graphics. setColor(Color c)
Sets this graphics context's current color to the specified color.void
MenuComponent.AccessibleAWTMenuComponent. setForeground(Color c)
Sets the foreground color of this object.void
List.AccessibleAWTList.AccessibleAWTListChild. setForeground(Color c)
Set the foreground color of this object.void
Component. setForeground(Color c)
Sets the foreground color of this component.void
Component.AccessibleAWTComponent. setForeground(Color c)
Sets the foreground color of this object.abstract void
Graphics. setXORMode(Color c1)
Sets the paint mode of this graphics context to alternate between this graphics context's current color and the new specified color.Constructors in java.awt with parameters of type Color Constructor and Description GradientPaint(float x1, float y1, Color color1, float x2, float y2, Color color2)
Constructs a simple acyclicGradientPaint
object.GradientPaint(float x1, float y1, Color color1, float x2, float y2, Color color2, boolean cyclic)
Constructs either a cyclic or acyclicGradientPaint
object depending on theboolean
parameter.GradientPaint(java.awt.geom.Point2D pt1, Color color1, java.awt.geom.Point2D pt2, Color color2)
Constructs a simple acyclicGradientPaint
object.GradientPaint(java.awt.geom.Point2D pt1, Color color1, java.awt.geom.Point2D pt2, Color color2, boolean cyclic)
Constructs either a cyclic or acyclicGradientPaint
object depending on theboolean
parameter.LinearGradientPaint(float startX, float startY, float endX, float endY, float[] fractions, Color[] colors)
Constructs aLinearGradientPaint
with a defaultNO_CYCLE
repeating method andSRGB
color space.LinearGradientPaint(float startX, float startY, float endX, float endY, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
Constructs aLinearGradientPaint
with a defaultSRGB
color space.LinearGradientPaint(java.awt.geom.Point2D start, java.awt.geom.Point2D end, float[] fractions, Color[] colors)
Constructs aLinearGradientPaint
with a defaultNO_CYCLE
repeating method andSRGB
color space.LinearGradientPaint(java.awt.geom.Point2D start, java.awt.geom.Point2D end, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
Constructs aLinearGradientPaint
with a defaultSRGB
color space.LinearGradientPaint(java.awt.geom.Point2D start, java.awt.geom.Point2D end, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod, MultipleGradientPaint.ColorSpaceType colorSpace, java.awt.geom.AffineTransform gradientTransform)
Constructs aLinearGradientPaint
.RadialGradientPaint(float cx, float cy, float radius, float[] fractions, Color[] colors)
Constructs aRadialGradientPaint
with a defaultNO_CYCLE
repeating method andSRGB
color space, using the center as the focus point.RadialGradientPaint(float cx, float cy, float radius, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
Constructs aRadialGradientPaint
with a defaultSRGB
color space, using the center as the focus point.RadialGradientPaint(float cx, float cy, float radius, float fx, float fy, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
Constructs aRadialGradientPaint
with a defaultSRGB
color space.RadialGradientPaint(java.awt.geom.Point2D center, float radius, float[] fractions, Color[] colors)
Constructs aRadialGradientPaint
with a defaultNO_CYCLE
repeating method andSRGB
color space, using the center as the focus point.RadialGradientPaint(java.awt.geom.Point2D center, float radius, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
Constructs aRadialGradientPaint
with a defaultSRGB
color space, using the center as the focus point.RadialGradientPaint(java.awt.geom.Point2D center, float radius, java.awt.geom.Point2D focus, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
Constructs aRadialGradientPaint
with a defaultSRGB
color space.RadialGradientPaint(java.awt.geom.Point2D center, float radius, java.awt.geom.Point2D focus, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod, MultipleGradientPaint.ColorSpaceType colorSpace, java.awt.geom.AffineTransform gradientTransform)
Constructs aRadialGradientPaint
.RadialGradientPaint(java.awt.geom.Rectangle2D gradientBounds, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
Constructs aRadialGradientPaint
with a defaultSRGB
color space.
-