public class RMColor
extends com.reportmill.base.RMObject
Modifier and Type | Field and Description |
---|---|
static RMColor |
black |
static RMColor |
blue |
static RMColor |
clear |
static RMColor |
clearWhite |
static RMColor |
cyan |
static RMColor |
darkGray |
static RMColor |
gray |
static RMColor |
green |
static RMColor |
lightBlue |
static RMColor |
lightGray |
static RMColor |
magenta |
static RMColor |
orange |
static RMColor |
pink |
static RMColor |
red |
static RMColor |
white |
static RMColor |
yellow |
Constructor and Description |
---|
RMColor()
Creates a plain black opaque color.
|
RMColor(java.awt.Color awt)
Creates an RMColor from the given AWT color.
|
RMColor(float g)
Creates a color with the given gray value (0-1).
|
RMColor(float g,
float a)
Creates a color with the given gray and alpha values (0-1).
|
RMColor(float r,
float g,
float b)
Creates a color with the given red, green blue values (0-1).
|
RMColor(float r,
float g,
float b,
float a)
Creates a color with the given red, green, blue values (0-1).
|
RMColor(float c,
float m,
float y,
float k,
float a)
Creates a color with the given cyan, magenta, yellow, black and alpha values (0-1).
|
RMColor(java.lang.String aHexString)
Creates a new color from the given hex string.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
awt()
Returns an AWT version of this color.
|
java.awt.Color |
awt(float dissolve)
Returns an AWT version of this color, with the alpha component scaled by the given dissolve factor.
|
RMColor |
blend(RMColor aColor,
double aFraction)
Returns a color darker than this color (by this given fraction).
|
RMColor |
brighter()
Returns a color 70% brighter than this color.
|
RMColor |
brighter(float aFactor)
Retures a color with the given percent brighter than this color.
|
static RMColor |
colorValue(java.lang.Object anObj)
Returns a color value for a given object.
|
RMColor |
darker()
Returns a color darker than this color (70% of this color's brightness).
|
boolean |
equals(java.lang.Object anObj)
Standar equals implementaiton.
|
java.lang.Object |
fromXML(com.reportmill.archiver.RXArchiver anArchiver,
com.reportmill.archiver.RXElement anElement,
java.lang.Object anOwner)
XML unarchival.
|
int |
getAlpha()
Returns the alpha component in the range 0-255.
|
float |
getAlpha2D()
Returns the alpha component in the range 0-1.
|
int |
getBlue()
Returns the blue component in the range 0-255.
|
float |
getBlue2D()
Returns the blue component in the range 0-1.
|
int |
getGreen()
Returns the green component in the range 0-255.
|
float |
getGreen2D()
Returns the green component in the range 0-1.
|
int |
getRed()
Returns the red component in the range 0-255.
|
float |
getRed2D()
Returns the red component in the range 0-1.
|
static float[] |
rgbToLab(float r,
float g,
float b)
Converts an RGB triplet to a CIELab triplet
|
java.lang.String |
toHexString()
Returns a hex string representation of this color.
|
float[] |
toLab()
Converts an RMColor to a CIELab triplet
|
java.lang.String |
toString()
Returns a string representation of this color.
|
com.reportmill.archiver.RXElement |
toXML(com.reportmill.archiver.RXArchiver anArchiver,
java.lang.Object anOwner)
XML archival.
|
addListener, addPropertyChangeListener, animUpdate, clone, firePropertyChange, firePropertyChange, getListener, getListenerCount, getListeners, isFirePropertyChangeEnabled, isUndoing, removeListener, removePropertyChangeListener, setFirePropertyChangeEnabled, setUndoing
public static RMColor black
public static RMColor blue
public static RMColor cyan
public static RMColor darkGray
public static RMColor gray
public static RMColor green
public static RMColor lightGray
public static RMColor magenta
public static RMColor orange
public static RMColor pink
public static RMColor red
public static RMColor white
public static RMColor yellow
public static RMColor clear
public static RMColor lightBlue
public static RMColor clearWhite
public RMColor()
public RMColor(float g)
public RMColor(float g, float a)
public RMColor(float r, float g, float b)
public RMColor(float r, float g, float b, float a)
public RMColor(float c, float m, float y, float k, float a)
public RMColor(java.awt.Color awt)
public RMColor(java.lang.String aHexString)
public int getRed()
public int getGreen()
public int getBlue()
public int getAlpha()
public float getRed2D()
public float getGreen2D()
public float getBlue2D()
public float getAlpha2D()
public RMColor brighter()
public RMColor brighter(float aFactor)
public RMColor darker()
public RMColor blend(RMColor aColor, double aFraction)
public boolean equals(java.lang.Object anObj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class com.reportmill.base.RMObject
public java.lang.String toHexString()
public java.awt.Color awt()
public java.awt.Color awt(float dissolve)
public static RMColor colorValue(java.lang.Object anObj)
public com.reportmill.archiver.RXElement toXML(com.reportmill.archiver.RXArchiver anArchiver, java.lang.Object anOwner)
public java.lang.Object fromXML(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement, java.lang.Object anOwner)
public static float[] rgbToLab(float r, float g, float b)
public float[] toLab()