|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnextapp.echo2.app.Color
com.sptci.echo2.style.Color
public class Color
A custom Color class to use in styles. This class is used to cache colours across sessions to reduce memory consumption.
The following shows the recommended way to use this class:
import com.sptci.echo2.style.Color;
...
Color one = Color.getInstance( 0xffccbb );
Color two = Color.getInstance( 254, 176, 10 );
© Copyright 2007 Sans Pareil Technologies, Inc.
| Field Summary | |
|---|---|
protected static Map<Integer,Color> |
cache
The cache of reusable colour instances. |
| Fields inherited from class nextapp.echo2.app.Color |
|---|
BLACK, BLUE, CYAN, DARKGRAY, GREEN, LIGHTGRAY, MAGENTA, ORANGE, PINK, RED, WHITE, YELLOW |
| Constructor Summary | |
|---|---|
Color(int rgb)
Deprecated. Use getInstance( int ) instead. |
|
Color(int red,
int green,
int blue)
Deprecated. Use getInstance( int, int, int ) instead. |
|
| Method Summary | |
|---|---|
static Color |
getInstance(int rgb)
Return a cached colour instance representing the specified RGB value. |
static Color |
getInstance(int red,
int green,
int blue)
Return a cached colour instance representing the specified RGB value. |
| Methods inherited from class nextapp.echo2.app.Color |
|---|
equals, getBlue, getGreen, getRed, getRgb, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final Map<Integer,Color> cache
key to the map
is the Color.rgb value.
| Constructor Detail |
|---|
@Deprecated public Color(int rgb)
getInstance( int ) instead.
rgb - An integer representation for a color
@Deprecated
public Color(int red,
int green,
int blue)
getInstance( int, int, int ) instead.
red - The red component of the colourgreen - The green component of the colourblue - The blue component of the colour| Method Detail |
|---|
public static Color getInstance(int rgb)
rgb - An integer representation of a colour.
public static Color getInstance(int red,
int green,
int blue)
red - The red component of the colourgreen - The green component of the colourblue - The blue component of the colour
|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||