public class RGBColorBean extends AnchorBean<RGBColorBean>
Constructor and Description |
---|
RGBColorBean()
Creates with a completely black color.
|
RGBColorBean(Color color)
Create from a
Color . |
RGBColorBean(int red,
int green,
int blue)
Create from values for red, green and blue.
|
RGBColorBean(RGBColor color)
Create from a
RGBColor . |
Modifier and Type | Method and Description |
---|---|
RGBColorBean |
duplicateBean()
Creates a new bean that deep-copies every property value.
|
int |
getBlue()
The blue component value of the RGB color.
|
int |
getGreen()
The green component value of the RGB color.
|
int |
getRed()
The red component value of the RGB color.
|
int |
getRGB()
Returns the RGB value encoded as an int as in
Color.getRGB() . |
void |
setBlue(int value)
Sets the blue component value.
|
void |
setGreen(int value)
Sets the green component value.
|
void |
setRed(int value)
Sets the red component value.
|
Color |
toAWTColor()
Converts to a
Color representation. |
RGBColor |
toRGBColor()
The
RGBColor associated with the bean. |
checkMisconfigured, describeBean, describeChildren, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public RGBColorBean()
i.e. Red, green, blue values are assigned 0
public RGBColorBean(RGBColor color)
RGBColor
.color
- the color, which continues to be used internally after the constructor call.public RGBColorBean(Color color)
Color
.color
- the color, which is no longer used internally after the constructor call.public RGBColorBean(int red, int green, int blue)
red
- the value for the red color component.green
- the value for the green color component.blue
- the value for the blue color component.public int getRed()
public int getGreen()
public int getBlue()
public void setRed(int value)
value
- the value to assignpublic void setGreen(int value)
value
- the value to assignpublic void setBlue(int value)
value
- the value to assignpublic int getRGB()
Color.getRGB()
.public RGBColor toRGBColor()
RGBColor
associated with the bean.public Color toAWTColor()
Color
representation.public RGBColorBean duplicateBean()
AnchorBean
Any state that is not a BeanField
is ignored.
duplicateBean
in class AnchorBean<RGBColorBean>
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.