|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectzombie.core.Color
public class Color
A simple wrapper round the values required for a colour
Field Summary | |
---|---|
float |
a
The alpha component of the colour |
float |
b
The blue component of the colour |
static Color |
black
The fixed colour black |
static Color |
blue
The fixed colour blue |
static Color |
cyan
The fixed colour cyan |
static Color |
darkGray
The fixed colour dark gray |
float |
g
The green component of the colour |
static Color |
gray
The fixed colour gray |
static Color |
green
The fixed colour green |
static Color |
lightGray
The fixed colour light gray |
static Color |
magenta
The fixed colour dark magenta |
static Color |
orange
The fixed colour dark orange |
static Color |
pink
The fixed colour dark pink |
float |
r
The red component of the colour |
static Color |
red
The fixed colour red |
static Color |
transparent
The fixed color transparent |
static Color |
white
The fixed colour white |
static Color |
yellow
The fixed colour yellow |
Constructor Summary | |
---|---|
Color(Color color)
Copy constructor |
|
Color(Color A,
Color B,
float delta)
|
|
Color(float r,
float g,
float b)
Create a 3 component colour |
|
Color(float r,
float g,
float b,
float a)
Create a 4 component colour |
|
Color(int value)
Create a colour from an evil integer packed 0xAARRGGBB. |
|
Color(int r,
int g,
int b)
Create a 3 component colour |
|
Color(int r,
int g,
int b,
int a)
Create a 4 component colour |
Method Summary | |
---|---|
void |
add(Color c)
Add another colour to this one |
Color |
addToCopy(Color c)
Add another colour to this one |
Color |
brighter()
Make a brighter instance of this colour |
Color |
brighter(float scale)
Make a brighter instance of this colour |
Color |
darker()
Make a darker instance of this colour |
Color |
darker(float scale)
Make a darker instance of this colour |
static Color |
decode(java.lang.String nm)
Decode a number in a string and process it as a colour reference. |
boolean |
equals(java.lang.Object other)
|
void |
fromColor(int value)
|
int |
getAlpha()
get the alpha byte component of this colour |
int |
getAlphaByte()
get the alpha byte component of this colour |
float |
getAlphaFloat()
|
int |
getBlue()
get the blue byte component of this colour |
int |
getBlueByte()
get the blue byte component of this colour |
float |
getBlueFloat()
|
int |
getGreen()
get the green byte component of this colour |
int |
getGreenByte()
get the green byte component of this colour |
float |
getGreenFloat()
|
int |
getRed()
get the red byte component of this colour |
int |
getRedByte()
get the red byte component of this colour |
float |
getRedFloat()
|
int |
hashCode()
|
void |
interp(Color to,
float delta,
Color dest)
|
Color |
multiply(Color c)
Multiply this color by another |
void |
scale(float value)
Scale the components of the colour by the given value |
Color |
scaleCopy(float value)
Scale the components of the colour by the given value |
void |
set(Color other)
|
void |
setColor(Color A,
Color B,
float delta)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Color transparent
public static final Color white
public static final Color yellow
public static final Color red
public static final Color blue
public static final Color green
public static final Color black
public static final Color gray
public static final Color cyan
public static final Color darkGray
public static final Color lightGray
public static final Color pink
public static final Color orange
public static final Color magenta
public float a
public float b
public float g
public float r
Constructor Detail |
---|
public Color(Color color)
color
- The color to copy into the new instancepublic Color(float r, float g, float b)
r
- The red component of the colour (0.0 -> 1.0)g
- The green component of the colour (0.0 -> 1.0)b
- The blue component of the colour (0.0 -> 1.0)public Color(float r, float g, float b, float a)
r
- The red component of the colour (0.0 -> 1.0)g
- The green component of the colour (0.0 -> 1.0)b
- The blue component of the colour (0.0 -> 1.0)a
- The alpha component of the colour (0.0 -> 1.0)public Color(Color A, Color B, float delta)
public Color(int r, int g, int b)
r
- The red component of the colour (0 -> 255)g
- The green component of the colour (0 -> 255)b
- The blue component of the colour (0 -> 255)public Color(int r, int g, int b, int a)
r
- The red component of the colour (0 -> 255)g
- The green component of the colour (0 -> 255)b
- The blue component of the colour (0 -> 255)a
- The alpha component of the colour (0 -> 255)public Color(int value)
value
- The value to interpret for the colourMethod Detail |
---|
public void setColor(Color A, Color B, float delta)
public void fromColor(int value)
public static Color decode(java.lang.String nm)
nm
- The number string to decode
public void add(Color c)
c
- The colour to addpublic Color addToCopy(Color c)
c
- The colour to add
public Color brighter()
public Color brighter(float scale)
scale
- The scale up of RGB (i.e. if you supply 0.03 the colour will be brightened by 3%)
public Color darker()
public Color darker(float scale)
scale
- The scale down of RGB (i.e. if you supply 0.03 the colour will be darkened by 3%)
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public void set(Color other)
public int getAlpha()
public float getAlphaFloat()
public float getRedFloat()
public float getGreenFloat()
public float getBlueFloat()
public int getAlphaByte()
public int getBlue()
public int getBlueByte()
public int getGreen()
public int getGreenByte()
public int getRed()
public int getRedByte()
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public Color multiply(Color c)
c
- the other color
public void scale(float value)
value
- The value to scale bypublic Color scaleCopy(float value)
value
- The value to scale by
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public void interp(Color to, float delta, Color dest)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |