Modifier and Type | Field and Description |
---|---|
static GColor |
INHERIT
The inherited color, used for CSS.
|
static HashMap<Integer,String> |
namesForColors
The map of colors to name where only the first entry is taken.
|
static GColor |
NONE
The no-color, i.e.
|
Constructor and Description |
---|
GColor(int rgb)
Creates an opaque RGB color object.
|
GColor(int argb,
boolean hasAlpha)
Creates an opaque [A]RGB color object.
|
GColor(int r,
int g,
int b)
Creates an opaque RGB color object.
|
GColor(int r,
int g,
int b,
double a)
Creates an ARGB color object.
|
GColor(int r,
int g,
int b,
int a)
Creates an ARGB color object.
|
Modifier and Type | Method and Description |
---|---|
void |
appendColor(Transaction trans)
Appends the color to a transaction.
|
static GColor |
createGColor(String string)
Creates a GColor from a String.
|
boolean |
equals(GColor color)
Checks if two color objects are equal.
|
boolean |
equals(Object o)
Checks if two color objects are equal.
|
static GColor |
from(Transaction trans)
Creates a color from a transaction.
|
int |
getColor()
Gets the color value as ARGB.
|
static String[] |
getColorNames()
Returns a list of all the color names sorted in alphabetical order.
|
String |
getCSSValue()
Gets the shortest CSS color string for this color.
|
String |
getName()
Returns the color name.
|
static int |
getRGBColorFromCSS3Name(String name)
Gets a color RGB value from a CSS3 color name.
|
String |
getString()
Gets the color as a String in the form described below.
|
int |
hashCode()
Hash code.
|
boolean |
isInherited()
Returns whether the color is inherited or not.
|
boolean |
isOpaque()
Checks if this color is (100%) opaque and not a color by name or not a system color,
i.e.
|
boolean |
isThemeColor()
Returns the theme color flag.
|
boolean |
isTransparent()
Checks if this color is transparent, or no color is set.
|
protected String |
paramString()
Returns the parameter string representing the state of this event.
|
static GColor |
parseGColor(String string)
Parses an HTML color String, such as "#nnn", "#123456", "rgb(r,g,b)", "rgba(r,g,b,a)" or a named color.
|
String |
toString()
Returns a string representation of this class instance and its values.
|
public static final GColor NONE
public static final GColor INHERIT
public GColor(int r, int g, int b)
r
- The red color (0-255).g
- The green color (0-255).b
- The build color (0-255).IllegalArgumentException
- if any r,g,b color is not 0-255.public GColor(int r, int g, int b, int a)
r
- The red color (0-255).g
- The green color (0-255).b
- The build color (0-255).a
- The alpha (0-255), 0=transparent, 255=opaque.IllegalArgumentException
- if any r,g,b color is not 0-255.public GColor(int r, int g, int b, double a)
r
- The red color (0-255).g
- The green color (0-255).b
- The build color (0-255).a
- The alpha (0.0-1.0), 0.0=transparent, 1.0=opaque.IllegalArgumentException
- if any r,g,b color is not 0-255.public GColor(int rgb)
rgb
- The integer red, green and blue colors.IllegalArgumentException
- if rgb
< 0 or rgb
> 0xFFFFFF.public GColor(int argb, boolean hasAlpha)
argb
- The alpha-blended integer red, green and blue colors.hasAlpha
- If false, sets alpha-blend part to 255.IllegalArgumentException
- if any r,g,b color is not 0-255.public static String[] getColorNames()
public static int getRGBColorFromCSS3Name(String name)
name
- The color name.public static GColor createGColor(String string)
new GColor(string)
was called.string
- The string as 0xnnnnnnnn or decimal.
It can be null or empty string for GColor.NONE,
or "inherit" for GColor.INHERIT.IllegalArgumentException
- for errors in the string specification.NumberFormatException
- for invalid number formats.public static GColor parseGColor(String string) throws ParseException
ParseException
- If parsing failed.public static GColor from(Transaction trans)
trans
- The transaction.public String getName()
public boolean isThemeColor()
public void appendColor(Transaction trans)
trans
- The transaction.public boolean equals(Object o)
public boolean equals(GColor color)
color
- another color object. If null, the colors are not equal.public int hashCode()
public boolean isInherited()
public boolean isTransparent()
public boolean isOpaque()
public int getColor()
public String getString()
protected String paramString()
public String toString()
public String getCSSValue()
iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.