Package com.reportmill.graphics
Class RMColor
java.lang.Object
com.reportmill.base.RMObject
com.reportmill.graphics.RMColor
- All Implemented Interfaces:
- RMArchiver.Archiving,- Cloneable
This class represents an RGBA color, just like Java.awt.Color. It was originally needed when running without
 AWT. It still has some convenience, but maybe one day should be replaced by, or just subclass, Java.awt.Color.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionRMColor()Creates a plain black opaque 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).Creates an RMColor from the given AWT color.Creates a new color from the given hex string.
- 
Method SummaryModifier and TypeMethodDescriptionawt()Returns an AWT version of this color.awt(float dissolve) Returns an AWT version of this color, with the alpha component scaled by the given dissolve factor.Returns a color darker than this color (by this given fraction).brighter()Returns a color 70% brighter than this color.brighter(float aFactor) Retures a color with the given percent brighter than this color.static RMColorcolorValue(Object anObj) Returns a color value for a given object.darker()Returns a color darker than this color (70% of this color's brightness).booleanStandar equals implementaiton.fromXML(RXArchiver anArchiver, RXElement anElement) XML unarchival.intgetAlpha()Returns the alpha component in the range 0-255.floatReturns the alpha component in the range 0-1.intgetBlue()Returns the blue component in the range 0-255.floatReturns the blue component in the range 0-1.intgetGreen()Returns the green component in the range 0-255.floatReturns the green component in the range 0-1.intgetRed()Returns the red component in the range 0-255.floatgetRed2D()Returns the red component in the range 0-1.initWithArchiver(RMArchiver anArchiver) Legacy unarchival.Returns a hex string representation of this color.toString()Returns a string representation of this color.toXML(RXArchiver anArchiver) XML archival.Methods inherited from class com.reportmill.base.RMObjectclone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, undoClone, undoCopy, undoEquals
- 
Field Details- 
black
- 
blue
- 
cyan
- 
darkGray
- 
gray
- 
green
- 
lightGray
- 
magenta
- 
orange
- 
pink
- 
red
- 
white
- 
yellow
- 
clear
- 
lightBlue
- 
clearWhite
 
- 
- 
Constructor Details- 
RMColorpublic RMColor()Creates a plain black opaque color.
- 
RMColorpublic RMColor(float g) Creates a color with the given gray value (0-1).
- 
RMColorpublic RMColor(float g, float a) Creates a color with the given gray and alpha values (0-1).
- 
RMColorpublic RMColor(float r, float g, float b) Creates a color with the given red, green blue values (0-1).
- 
RMColorpublic RMColor(float r, float g, float b, float a) Creates a color with the given red, green, blue values (0-1).
- 
RMColorpublic 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).
- 
RMColorCreates an RMColor from the given AWT color.
- 
RMColorCreates a new color from the given hex string.
 
- 
- 
Method Details- 
getRedpublic int getRed()Returns the red component in the range 0-255.
- 
getGreenpublic int getGreen()Returns the green component in the range 0-255.
- 
getBluepublic int getBlue()Returns the blue component in the range 0-255.
- 
getAlphapublic int getAlpha()Returns the alpha component in the range 0-255.
- 
getRed2Dpublic float getRed2D()Returns the red component in the range 0-1.
- 
getGreen2Dpublic float getGreen2D()Returns the green component in the range 0-1.
- 
getBlue2Dpublic float getBlue2D()Returns the blue component in the range 0-1.
- 
getAlpha2Dpublic float getAlpha2D()Returns the alpha component in the range 0-1.
- 
brighterReturns a color 70% brighter than this color.
- 
brighterRetures a color with the given percent brighter than this color.
- 
darkerReturns a color darker than this color (70% of this color's brightness).
- 
blendReturns a color darker than this color (by this given fraction).
- 
equalsStandar equals implementaiton.
- 
toStringReturns a string representation of this color.
- 
toHexStringReturns a hex string representation of this color.
- 
awtReturns an AWT version of this color.
- 
awtReturns an AWT version of this color, with the alpha component scaled by the given dissolve factor.
- 
colorValueReturns a color value for a given object.
- 
toXMLXML archival.
- 
fromXMLXML unarchival.
- 
initWithArchiverLegacy unarchival.- Specified by:
- initWithArchiverin interface- RMArchiver.Archiving
- Overrides:
- initWithArchiverin class- RMObject
 
 
-