|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.ui.Color
public class Color
The Color class is a basic type used to contain color information and is used by many classes in the danger.ui package.
| Field Summary | |
|---|---|
int |
a
The alpha component. |
int |
b
The blue component. |
static int |
BLACK
Packed integer representation of the color black. |
static int |
BLUE
Packed integer representation of the color blue. |
static int |
CYAN
Packed integer representation of the color cyan. |
static int |
FUCHSIA
Packed integer representation of a shade of fuchsia. |
int |
g
The green component. |
static int |
GRAY0
Packed integer representation of a shade of gray. |
static int |
GRAY1
Packed integer representation of a shade of gray. |
static int |
GRAY10
Packed integer representation of a shade of gray. |
static int |
GRAY11
Packed integer representation of a shade of gray. |
static int |
GRAY12
Packed integer representation of a shade of gray. |
static int |
GRAY13
Packed integer representation of a shade of gray. |
static int |
GRAY14
Packed integer representation of a shade of gray. |
static int |
GRAY15
Packed integer representation of a shade of gray. |
static int |
GRAY2
Packed integer representation of a shade of gray. |
static int |
GRAY3
Packed integer representation of a shade of gray. |
static int |
GRAY4
Packed integer representation of a shade of gray. |
static int |
GRAY5
Packed integer representation of a shade of gray. |
static int |
GRAY6
Packed integer representation of a shade of gray. |
static int |
GRAY7
Packed integer representation of a shade of gray. |
static int |
GRAY8
Packed integer representation of a shade of gray. |
static int |
GRAY9
Packed integer representation of a shade of gray. |
static int |
GREEN
Packed integer representation of the color green. |
static int |
MAGENTA
Packed integer representation of the color magenta. |
static int |
ORANGE
Packed integer representation of the color orange. |
static int |
PINK
Packed integer representation of the color pink. |
static int |
PURPLE
Packed integer representation of the color purple. |
int |
r
The red component. |
static int |
RED
Packed integer representation of the color red. |
static int |
VIOLET
Packed integer representation of the color violet. |
static int |
WHITE
Packed integer representation of the color white. |
static int |
YELLOW
Packed integer representation of the color yellow. |
| Constructor Summary | |
|---|---|
Color()
Construct a new color which is completely black. |
|
Color(Color c)
Create a color object which is the same color as the specified color. |
|
Color(int packedColor)
Construct a new color from a packed rgb value. |
|
Color(int inR,
int inG,
int inB)
Construct a new color which has the specified R, G, and B values. |
|
Color(int inR,
int inG,
int inB,
int inA)
Construct a new color which has the specified R, G, and B values, as well as the specified alpha value. |
|
Color(String s)
Construct a new color from a string value. |
|
| Method Summary | |
|---|---|
void |
assign(int packedColor)
Change this color to have the specified color value |
void |
assign(int inR,
int inG,
int inB)
Change this color to have the specified red, green, and blue values. |
void |
assign(String s)
Change this color to have the specified color. |
static int |
blend(int fg,
int bg,
int opacity)
Blend two packed RGB color using a given opacity. |
static int |
colorize(int color,
int r,
int g,
int b)
Colorize one color with another. |
static boolean |
colorsEqual(int color1,
int color2)
Compare two colors. |
static int |
fromString(String s)
Return an integer value which represents the color specified by the string. |
static int |
pack(int r,
int g,
int b)
Return an integer which represents the color with the specified red, green, and blue values. |
static int |
pack(int r,
int g,
int b,
int a)
Return an integer which represents the color with the specified red, green, blue, and alpha values. |
int |
toPacked()
Return an integer which represents this color. |
String |
toString()
Return a string representation of the color, in hex format. |
static String |
toString(int packedColor)
Return a string representation of the specified packed color. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int a
public int r
public int g
public int b
public static final int BLACK
public static final int WHITE
public static final int RED
public static final int GREEN
public static final int BLUE
public static final int CYAN
public static final int MAGENTA
public static final int ORANGE
public static final int PURPLE
public static final int VIOLET
public static final int YELLOW
public static final int PINK
public static final int GRAY0
public static final int GRAY1
public static final int GRAY2
public static final int GRAY3
public static final int GRAY4
public static final int GRAY5
public static final int GRAY6
public static final int GRAY7
public static final int GRAY8
public static final int GRAY9
public static final int GRAY10
public static final int GRAY11
public static final int GRAY12
public static final int GRAY13
public static final int GRAY14
public static final int GRAY15
public static final int FUCHSIA
| Constructor Detail |
|---|
public Color(Color c)
public Color()
public Color(int packedColor)
packedColor - An integer with packed 8bit per channel RGB values.
Blue is the LSB. Alpha is the MSB.
public Color(int inR,
int inG,
int inB)
public Color(int inR,
int inG,
int inB,
int inA)
public Color(String s)
fromString(java.lang.String).
| Method Detail |
|---|
public int toPacked()
public static int pack(int r,
int g,
int b)
public static int pack(int r,
int g,
int b,
int a)
public String toString()
toString in class Objectpublic static String toString(int packedColor)
public static int fromString(String s)
public void assign(int inR,
int inG,
int inB)
public void assign(int packedColor)
packedColor - An integer with packed 8bit per channel RGB values.
Blue is the LSB. Alpha is the MSB.public void assign(String s)
s - The color specified as a string. See fromString(java.lang.String) for
possible values.
public static boolean colorsEqual(int color1,
int color2)
public static int blend(int fg,
int bg,
int opacity)
fg - the foreground color.bg - the background color.opacity - the opacity with which to blend the foreground on
the background. 0x00 is fully transparent. 0xff is fully opaque.
public static int colorize(int color,
int r,
int g,
int b)
color - the color.r - red component to colorize color by.g - green component to colorize color by.b - blue component to colorize color by.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||