|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaclib.RGBColor
public class RGBColor
This class implements QuickDraw-like definitions for RGB colors
where each component is valued between
0
and 65535
.
MacLib
,
Color
Field Summary | |
---|---|
int |
blue
The blue component. |
int |
green
The green component. |
int |
red
The red component. |
Constructor Summary | |
---|---|
RGBColor()
Constructs and initializes a color with components (0,0,0,0) , that is the black color. |
|
RGBColor(int r,
int g,
int b)
Constructs and initializes a color with the given components. |
Method Summary | |
---|---|
java.awt.Color |
getColor()
Converts this color as a java.awt.Color object. |
int |
hashCode()
Returns a hash code for this color. |
RGBColor |
setColor(java.awt.Color color)
Sets the components of this color as specified by the given java.awt.Color object. |
java.lang.String |
toString()
Returns a string representation for this color. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int red
public int green
public int blue
Constructor Detail |
---|
public RGBColor()
(0,0,0,0)
, that is the black color.
public RGBColor(int r, int g, int b)
r
- the red component of the new color.g
- the green component of the new color.b
- the blue component of the new color.Method Detail |
---|
public java.awt.Color getColor()
java.awt.Color
object.
Color
public RGBColor setColor(java.awt.Color color)
java.awt.Color
object.
color
- the Color object used to specify the components.Color
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |