public final class ColorCache
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static org.eclipse.swt.graphics.RGB |
BLACK |
static org.eclipse.swt.graphics.RGB |
WHITE |
Modifier and Type | Method and Description |
---|---|
static void |
disposeAll()
Disposes all colors held in the cache and colors created when class is created.
|
static void |
disposeCachedColor()
Disposes the cached colors only.
|
static org.eclipse.swt.graphics.Color |
getBlack()
Returns the color black R0, G0, B0
|
static org.eclipse.swt.graphics.Color |
getColor(int red,
int green,
int blue)
Returns a color that is also cached if it has not been created before.
|
static org.eclipse.swt.graphics.Color |
getColor(org.eclipse.swt.graphics.RGB rgb)
Returns a color that is also cached if it has not been created before.
|
static org.eclipse.swt.graphics.Color |
getRandomColor()
Returns a random color.
|
static org.eclipse.swt.graphics.Color |
getWhite()
Returns the color white R255, G255, B255
|
public static final org.eclipse.swt.graphics.RGB BLACK
public static final org.eclipse.swt.graphics.RGB WHITE
public static void disposeAll()
IMPORTANT: ONLY CALL WHEN YOU WANT TO DISPOSE THE WIDGET USING THIS CLASS!
If you only wish to dispose colors you have created through the use of the class, please use disposeCachedColors()
disposeCachedColor()
public static void disposeCachedColor()
public static org.eclipse.swt.graphics.Color getWhite()
public static org.eclipse.swt.graphics.Color getBlack()
public static org.eclipse.swt.graphics.Color getColor(org.eclipse.swt.graphics.RGB rgb)
rgb
- RGB colorspublic static org.eclipse.swt.graphics.Color getColor(int red, int green, int blue)
red
- Redgreen
- Greenblue
- Bluepublic static org.eclipse.swt.graphics.Color getRandomColor()