|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectfang.Palette
public class Palette
This class represents a color as a red, green, blue triple whose range for each component is 0 .. 255. Colors can also be specified using the names given on this web page (note, case and spacing in the name do not matter):
| Constructor Summary | |
|---|---|
Palette()
|
|
| Method Summary | |
|---|---|
static void |
addColor(String name,
Color color)
|
static void |
addColor(String name,
String rgb)
|
static Color |
getColor(int red,
int green,
int blue)
Create a solid color with the given red, green, and blue values. |
static Color |
getColor(int red,
int green,
int blue,
int transparency)
Create a semi-transparent color with the given red, green, and blue values. |
static Color |
getColor(String name)
Create a solid color with from the name given on this web page. |
static Color |
getColor(String name,
int transparency)
Create a semi-transparent color with from the name given on this web page. |
static Color |
getColorFromRGB(String rgb)
|
static Color |
getColorFromRGB(String rgb,
int transparency)
|
static Map<String,Color> |
getColorMap()
|
static String |
getColorName(Color color)
|
static String |
getColorName(int r,
int g,
int b)
|
static String |
getColorName(String rgb)
|
static Color |
getRandomColor(Random random)
Generate a random color. |
static String |
getRGB(Color color)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Palette()
| Method Detail |
|---|
public static Color getColor(int red,
int green,
int blue)
public static Color getColor(int red,
int green,
int blue,
int transparency)
public static Color getColor(String name)
public static Color getColor(String name,
int transparency)
public static String getColorName(int r,
int g,
int b)
public static String getColorName(String rgb)
public static String getColorName(Color color)
public static Color getColorFromRGB(String rgb)
public static Color getColorFromRGB(String rgb,
int transparency)
public static Color getRandomColor(Random random)
random - - a Random object used to generate random numbers; this class is ignorant of
other FANG classes so it does not poke around in the current game to find the Random that is
there. Callers provide the Random (Game.getRandomColor() does this under the hood).
public static String getRGB(Color color)
public static Map<String,Color> getColorMap()
public static void addColor(String name,
Color color)
public static void addColor(String name,
String rgb)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||