public class Color extends Object
implements Paint,
Serializable
Campi (static)
Nome | 0.0F...1.0F | 0...255 | Descrizione | R | G | B | R | G | B |
---|
BLACK | black | 0.0 | 0.0 | 0.0 |
0 | 0 | 0 | Nero |
BLUE | blue | 0.0 | 0.0 | 1.0 |
0 | 0 | 255 | Blu |
CYAN | cyan | 0.0 | 1.0 | 1.0 |
0 | 255 | 255 | Azzurro |
DARK_GRAY | darkGray | 0.25 | 0.25 | 0.25 |
64 | 64 | 64 | Grigio scuro |
GRAY | gray | 0.5 | 0.5 | 0.5 |
128 | 128 | 128 | Grigio |
GREEN | green | 0.0 | 1.0 | 0.0 |
0 | 255 | 0 | Verde |
LIGHT_GRAY | lightGray | 0.75 | 0.75 | 0.75 |
192 | 192 | 192 | Grigio chiaro |
MAGENTA | magenta | 1.0 | 0.0 | 1.0 |
255 | 0 | 255 | Magenta |
ORANGE | orange | 1.0 | 0.784 | 0 |
255 | 200 | 0 | Arancione |
PINK | pink | 1.0 | 0.686 | 0.686 |
255 | 175 | 175 | Rosa |
RED | red | 1.0 | 0.0 | 0.0 |
255 | 0 | 0 | Rosso |
WHITE | white | 1.0 | 1.0 | 1.0 |
255 | 255 | 255 | Bianco |
YELLOW | yellow | 1.0 | 1.0 | 0.0 |
255 | 255 | 0 | Giallo |
Sono i 13 colori di default di AWT
Costruttori
Parametri | Descrizione |
---|
float, float, float | R, G, B (0.0F..1.0F) | float, float, float, float | R, G, B, Alpha | int | RGB (0..224-1) | int, boolean | sRGB, Alpha? | int, int, int | R, G, B (0..255) | int, int, int, int | R, G, B, Alpha |
Metodi (static)
Nome | Argomenti | Tipo | Descrizione |
decode
|
String
|
Color
| 0x..., 0X..., #..., 0... |
getHSBColor
|
float, float, float
| hue, saturation, brightness [0..1] |
HSBtoRGB
|
float, float, float
|
int
| hue, saturation, brightness [0..1] --> RGB |
RGBtoHSB
|
int, int, int, null
|
float[]
| red, green, blue --> HSB [0..1] |
int, int, int, float[]
|
null
|
Metodi
Nome | Argomenti | Tipo | Descrizione |
---|
getAlpha
getBlue
getGreen
getRed
getTransparency | | int | Componenti | getRGB | 0..232-1 (sRGB) | getRGBColorComponents | | float[] | 3 componenti RGB | getRGBComponents | 4 componenti sRGB | brighter
darker | | Color | Un colore pił chiaro/scuro |
|