|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.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 |
protected SGL |
GL
The renderer to use for all GL operations |
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(java.nio.FloatBuffer buffer)
Create a component based on the first 4 elements of a float buffer |
|
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 |
void |
bind()
Bind this colour to the GL context |
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)
|
int |
getAlpha()
Get the alpha byte component of this colour |
int |
getAlphaByte()
Get the alpha byte component of this colour |
int |
getBlue()
Get the blue byte component of this colour |
int |
getBlueByte()
Get the blue byte component of this colour |
int |
getGreen()
Get the green byte component of this colour |
int |
getGreenByte()
Get the green byte component of this colour |
int |
getRed()
Get the red byte component of this colour |
int |
getRedByte()
Get the red byte component of this colour |
int |
hashCode()
|
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 |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected transient SGL GL
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 r
public float g
public float b
public float a
Constructor Detail |
---|
public Color(Color color)
color
- The color to copy into the new instancepublic Color(java.nio.FloatBuffer buffer)
buffer
- The buffer to read the color frompublic 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(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 static Color decode(java.lang.String nm)
nm
- The number string to decode
public void bind()
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
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 Color brighter()
public int getRed()
public int getGreen()
public int getBlue()
public int getAlpha()
public int getRedByte()
public int getGreenByte()
public int getBlueByte()
public int getAlphaByte()
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 multiply(Color c)
c
- the other color
public void add(Color c)
c
- The colour to addpublic void scale(float value)
value
- The value to scale bypublic Color addToCopy(Color c)
c
- The colour to add
public Color scaleCopy(float value)
value
- The value to scale by
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |