|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.graphics.Color
public class Color
The Color class defines methods for creating and converting color ints. Colors are represented as packed ints, made up of 4 bytes: alpha, red, green, blue. The values are unpremultiplied, meaning any transparency is stored solely in the alpha component, and not in the color components. The components are stored as follows (alpha << 24) | (red << 16) | (green << 8) | blue. Each component ranges between 0..255 with 0 meaning no contribution for that component, and 255 meaning 100% contribution. Thus opaque-black would be 0xFF000000 (100% opaque but no contributes from red, gree, blue, and opaque-white would be 0xFFFFFFFF
| Field Summary | |
|---|---|
static int |
BLACK
|
static int |
BLUE
|
static int |
CYAN
|
static int |
DKGRAY
|
static int |
GRAY
|
static int |
GREEN
|
static int |
LTGRAY
|
static int |
MAGENTA
|
static int |
RED
|
static int |
TRANSPARENT
|
static int |
WHITE
|
static int |
YELLOW
|
| Constructor Summary | |
|---|---|
Color()
|
|
| Method Summary | |
|---|---|
static int |
alpha(int color)
Return the alpha component of a color int. |
static int |
argb(int alpha,
int red,
int green,
int blue)
Return a color-int from alpha, red, green, blue components. |
static int |
blue(int color)
Return the blue component of a color int. |
static void |
colorToHSV(int color,
float[] hsv)
Convert the argb color to its HSV components. |
static int |
green(int color)
Return the green component of a color int. |
static int |
HSVToColor(float[] hsv)
Convert HSV components to an ARGB color. |
static int |
HSVToColor(int alpha,
float[] hsv)
Convert HSV components to an ARGB color. |
static int |
parseColor(String colorString)
Parse the color string, and return the corresponding color-int. |
static int |
red(int color)
Return the red component of a color int. |
static int |
rgb(int red,
int green,
int blue)
Return a color-int from red, green, blue components. |
static void |
RGBToHSV(int red,
int green,
int blue,
float[] hsv)
Convert RGB components to HSV. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BLACK
public static final int DKGRAY
public static final int GRAY
public static final int LTGRAY
public static final int WHITE
public static final int RED
public static final int GREEN
public static final int BLUE
public static final int YELLOW
public static final int CYAN
public static final int MAGENTA
public static final int TRANSPARENT
| Constructor Detail |
|---|
public Color()
| Method Detail |
|---|
public static int alpha(int color)
public static int red(int color)
public static int green(int color)
public static int blue(int color)
public static int rgb(int red,
int green,
int blue)
red - Red component [0..255] of the colorgreen - Green component [0..255] of the colorblue - Blue component [0..255] of the color
public static int argb(int alpha,
int red,
int green,
int blue)
alpha - Alpha component [0..255] of the colorred - Red component [0..255] of the colorgreen - Green component [0..255] of the colorblue - Blue component [0..255] of the colorpublic static int parseColor(String colorString)
public static void RGBToHSV(int red,
int green,
int blue,
float[] hsv)
red - red component value [0..255]green - green component value [0..255]blue - blue component value [0..255]hsv - 3 element array which holds the resulting HSV components.
public static void colorToHSV(int color,
float[] hsv)
color - the argb color to convert. The alpha component is ignored.hsv - 3 element array which holds the resulting HSV components.public static int HSVToColor(float[] hsv)
hsv - 3 element array which holds the input HSV components.
public static int HSVToColor(int alpha,
float[] hsv)
alpha - the alpha component of the returned argb color.hsv - 3 element array which holds the input HSV components.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||