public class RMColor
extends java.lang.Object
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(double g)
Creates a color with the given gray value (0-1).
|
RMColor(double g,
double a)
Creates a color with the given gray and alpha values (0-1).
|
RMColor(double r,
double g,
double b)
Creates a color with the given red, green blue values (0-1).
|
RMColor(double r,
double g,
double b,
double a)
Creates a color with the given red, green, blue values (0-1).
|
RMColor(double c,
double m,
double y,
double k,
double a)
Creates a color with the given cyan, magenta, yellow, black and alpha values (0-1).
|
RMColor(int r,
int g,
int b)
Creates a color with the given red, green blue 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.
|
RMColor |
blend(RMColor aColor,
double aFraction)
Returns a color darker than this color (by this given fraction).
|
RMColor |
brighter()
Returns a color brighter than this color (blended with white).
|
static RMColor |
colorValue(java.lang.Object anObj)
Returns a color value for a given object.
|
RMColor |
darker()
Returns a color darker than this color (blended with black).
|
boolean |
equals(java.lang.Object anObj)
Standard equals implementation.
|
java.lang.Object |
fromXML(XMLArchiver anArchiver,
XMLElement anElement)
XML unarchival.
|
double |
getAlpha()
Returns the alpha component in the range 0-1.
|
int |
getAlphaInt()
Returns the alpha component in the range 0-255.
|
double |
getBlue()
Returns the blue component in the range 0-1.
|
int |
getBlueInt()
Returns the blue component in the range 0-255.
|
double |
getGreen()
Returns the green component in the range 0-1.
|
int |
getGreenInt()
Returns the green component in the range 0-255.
|
static RMColor |
getRandom()
Returns a random color.
|
double |
getRed()
Returns the red component in the range 0-1.
|
int |
getRedInt()
Returns the red component in the range 0-255.
|
int |
getRGBA()
Returns the color as an int.
|
static float[] |
rgbToLab(double r,
double g,
double 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.
|
XMLElement |
toXML(XMLArchiver anArchiver)
XML archival.
|
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(double g)
public RMColor(double g, double a)
public RMColor(double r, double g, double b)
public RMColor(int r, int g, int b)
public RMColor(double r, double g, double b, double a)
public RMColor(double c, double m, double y, double k, double a)
public RMColor(java.awt.Color awt)
public RMColor(java.lang.String aHexString)
public double getRed()
public double getGreen()
public double getBlue()
public double getAlpha()
public int getRedInt()
public int getGreenInt()
public int getBlueInt()
public int getAlphaInt()
public int getRGBA()
public RMColor brighter()
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 java.lang.Object
public java.lang.String toHexString()
public static RMColor colorValue(java.lang.Object anObj)
public float[] toLab()
public static float[] rgbToLab(double r, double g, double b)
public static RMColor getRandom()
public XMLElement toXML(XMLArchiver anArchiver)
public java.lang.Object fromXML(XMLArchiver anArchiver, XMLElement anElement)
public java.awt.Color awt()