RGBpublic class RGB extends Object implements org.w3c.dom.svg.SVGRGBColor, PaintServer, PaintDefClass which defines an Red, Green, Blue value. |
Fields Summary |
---|
int | rgbThe internal RGB value. | public static final RGB | blackPredefined Colors | public static final RGB | white | public static final RGB | blue | public static final RGB | orange | public static final RGB | red | public static final RGB | green | public static final RGB | yellow | public static final RGB | gray |
Constructors Summary |
---|
public RGB(int r, int g, int b)Constructs an RGB with the red, green,
and blue values.
this(255, r, g, b);
| public RGB(int a, int r, int g, int b)Constructs an RGB with the alpha, red, green,
and blue values.
rgb = (a << 24) | (r << 16) | (g << 8) | b;
|
Methods Summary |
---|
public void | dispose()Called when the PaintServer is no longer used
| public int | getAlpha()Returns the alpha component of the SVGRGBColor.
return 0x000000ff & (rgb >> 24);
| public int | getBlue()
return 0x000000ff & rgb;
| public int | getGreen()
return 0x000000ff & (rgb >> 8);
| public PaintDef | getPaintDef()
return this;
| public int | getRed()
return 0x000000ff & (rgb >> 16);
| public void | setPaint(PiscesRenderGraphics rg, com.sun.pisces.PiscesRenderer pr, int paintOpacity)Sets the paint on a PiscesRender.
pr.setColor(0xff & (rgb >> 16),
0xff & (rgb >> 8),
0xff & rgb,
(paintOpacity * (0xff & (rgb >> 24))) / 255);
| public void | setPaintTarget(java.lang.String paintType, PaintTarget paintTarget)
// Do nothing: RGB is non mutable in that it does not change the PaintDef value it
// returns from the getPaintDef method.
| public java.lang.String | toString()
StringBuffer sb = new StringBuffer();
sb.append("rgb(");
sb.append(getRed());
sb.append(",");
sb.append(getGreen());
sb.append(",");
sb.append(getBlue());
sb.append(")");
return sb.toString();
|
|