|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object android.image.ColorDatabase
public class ColorDatabase
Manages color names and translation to implementation-dependent Color structures.
Available colors are listed in the following table. If an undefined color is used then a RuntimeException
is thrown. Custom colors can be created using the static makeColor
methods.
Alternatively clients can specify a 7 character string beginning with a '#' (hash-mark) followed by a 6 digit hexadecimal number that encodes the requested RGB color, e.g., "#FF0000" for Red, or "#00FF00" for Green. For advanced users, a 9 character string beginning with a '#' followed by an 8 digit hexadecimal number that encodes the requested ARGB color (Alpha, Red, Green, Blue), e.g., "#FFFF0000" for Opaque Red, or "#8800FF00" for Half-Transparent Green.
Color names are case-insensitive.
"orange red" | |
"orangered" | |
"tomato" | |
"darkred" | |
"red" | |
"firebrick" | |
"crimson" | |
"deeppink" | |
"maroon" | |
"indian red" | |
"indianred" | |
"medium violet red" | |
"mediumvioletred" | |
"violet red" | |
"violetred" | |
"lightcoral" | |
"hotpink" | |
"palevioletred" | |
"lightpink" | |
"rosybrown" | |
"pink" | |
"orchid" | |
"lavenderblush" | |
"snow" | |
"chocolate" | |
"saddlebrown" | |
"brown" | |
"darkorange" | |
"coral" | |
"sienna" | |
"orange" | |
"salmon" | |
"peru" | |
"darkgoldenrod" | |
"goldenrod" | |
"sandybrown" | |
"lightsalmon" | |
"darksalmon" | |
"gold" | |
"yellow" | |
"olive" | |
"burlywood" | |
"tan" | |
"navajowhite" | |
"peachpuff" | |
"khaki" | |
"darkkhaki" | |
"moccasin" | |
"wheat" | |
"bisque" | |
"palegoldenrod" | |
"blanchedalmond" | |
"medium goldenrod" | |
"mediumgoldenrod" | |
"papayawhip" | |
"mistyrose" | |
"lemonchiffon" | |
"antiquewhite" | |
"cornsilk" | |
"lightgoldenrodyellow" | |
"oldlace" | |
"linen" | |
"lightyellow" | |
"seashell" | |
"beige" | |
"floralwhite" | |
"ivory" | |
"green" | |
"lawngreen" | |
"chartreuse" | |
"green yellow" | |
"greenyellow" | |
"yellow green" | |
"yellowgreen" | |
"medium forest green" | |
"olivedrab" | |
"mediumforestgreen" | |
"dark olive green" | |
"darkolivegreen" | |
"darkseagreen" | |
"lime" | |
"dark green" | |
"darkgreen" | |
"lime green" | |
"limegreen" | |
"forest green" | |
"forestgreen" | |
"spring green" | |
"springgreen" | |
"medium spring green" | |
"mediumspringgreen" | |
"sea green" | |
"seagreen" | |
"medium sea green" | |
"mediumseagreen" | |
"aquamarine" | |
"lightgreen" | |
"pale green" | |
"palegreen" | |
"medium aquamarine" | |
"mediumaquamarine" | |
"turquoise" | |
"lightseagreen" | |
"medium turquoise" | |
"mediumturquoise" | |
"honeydew" | |
"mintcream" | |
"royalblue" | |
"dodgerblue" | |
"deepskyblue" | |
"cornflowerblue" | |
"steel blue" | |
"steelblue" | |
"lightskyblue" | |
"dark turquoise" | |
"darkturquoise" | |
"cyan" | |
"aqua" | |
"darkcyan" | |
"teal" | |
"sky blue" | |
"skyblue" | |
"cadet blue" | |
"cadetblue" | |
"dark slate gray" | |
"darkslategray" | |
"lightslategray" | |
"slategray" | |
"dark slate grey" | |
"darkslategrey" | |
"lightslategrey" | |
"slategrey" | |
"light steel blue" | |
"lightsteelblue" | |
"light blue" | |
"lightblue" | |
"powderblue" | |
"paleturquoise" | |
"lightcyan" | |
"aliceblue" | |
"azure" | |
"medium blue" | |
"mediumblue" | |
"darkblue" | |
"midnight blue" | |
"midnightblue" | |
"navy" | |
"blue" | |
"indigo" | |
"blue violet" | |
"blueviolet" | |
"medium slate blue" | |
"mediumslateblue" | |
"slate blue" | |
"slateblue" | |
"purple" | |
"dark slate blue" | |
"darkslateblue" | |
"darkviolet" | |
"dark orchid" | |
"darkorchid" | |
"mediumpurple" | |
"cornflower blue" | |
"medium orchid" | |
"mediumorchid" | |
"magenta" | |
"fuchsia" | |
"darkmagenta" | |
"violet" | |
"plum" | |
"lavender" | |
"thistle" | |
"ghostwhite" | |
"white" | |
"whitesmoke" | |
"gainsboro" | |
"light gray" | |
"lightgray" | |
"light grey" | |
"lightgrey" | |
"silver" | |
"gray" | |
"dark gray" | |
"darkgray" | |
"dim gray" | |
"dimgray" | |
"dark grey" | |
"darkgrey" | |
"dim grey" | |
"dimgrey" | |
"black" |
Constructor Summary | |
---|---|
ColorDatabase()
|
Method Summary | |
---|---|
static int |
argbAlpha(int color)
Get the Alpha component of an integer Color in the ARGB format. |
static int |
argbBlue(int color)
Get the Blue component of an integer Color in the ARGB format. |
static int |
argbGreen(int color)
Get the Green component of an integer Color in the ARGB format. |
static int |
argbRed(int color)
Get the Red component of an integer Color in the ARGB format. |
static int |
color(java.lang.String s)
Get the java.awt.Color represented by the given string |
static int |
colorToARGB(double red,
double green,
double blue)
Convert the given Color intensities into ARGB integer format. |
static int |
colorToARGB(double alpha,
double red,
double green,
double blue)
Convert the given Alpha and Color intensities into ARGB integer format. |
static int |
colorToARGB(int red,
int green,
int blue)
Convert the given Color intensities into ARGB integer format. |
static int |
colorToARGB(int alpha,
int red,
int green,
int blue)
Convert the given Alpha and Color intensities into ARGB integer format. |
static int |
colorToARGB(java.lang.String c)
Convert the given Color String into ARGB integer format. |
static java.lang.String |
makeColor(double red,
double green,
double blue)
Create a color String from the given Red/Green/Blue fractional intensities in [0..1.0]. |
static java.lang.String |
makeColor(double alpha,
double red,
double green,
double blue)
Create a color String from the given Alpha/Red/Green/Blue fractional intensities in [0..1.0]. |
static java.lang.String |
makeColor(int color)
Create a color String from the given integer that encodes Alpha/Red/Green/Blue intensities. |
static java.lang.String |
makeColor(int red,
int green,
int blue)
Create a color String from the given Alpha/Red/Green/Blue intensities in [0..255]. |
static java.lang.String |
makeColor(int alpha,
int red,
int green,
int blue)
Create a color String from the given Alpha/Red/Green/Blue intensities in [0..255]. |
static int |
parseColor(java.lang.String c)
Parse a hex-Color from a 6 digit String (two each for Red, Green, Blue |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColorDatabase()
Method Detail |
---|
public static int color(java.lang.String s)
public static java.lang.String makeColor(int red, int green, int blue)
public static java.lang.String makeColor(int alpha, int red, int green, int blue)
public static java.lang.String makeColor(double red, double green, double blue)
public static java.lang.String makeColor(double alpha, double red, double green, double blue)
public static int colorToARGB(java.lang.String c)
public static int colorToARGB(double red, double green, double blue)
public static int colorToARGB(double alpha, double red, double green, double blue)
public static int colorToARGB(int red, int green, int blue)
public static int colorToARGB(int alpha, int red, int green, int blue)
public static java.lang.String makeColor(int color)
public static int argbAlpha(int color)
public static int argbRed(int color)
public static int argbGreen(int color)
public static int argbBlue(int color)
public static int parseColor(java.lang.String c)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |