public final class Color extends java.lang.Object implements ReadableColor, java.io.Serializable, WritableColor
| Constructor and Description |
|---|
Color()
Constructor for Color.
|
Color(byte r,
byte g,
byte b)
Constructor for Color.
|
Color(byte r,
byte g,
byte b,
byte a)
Constructor for Color.
|
Color(int r,
int g,
int b)
Constructor for Color.
|
Color(int r,
int g,
int b,
int a)
Constructor for Color.
|
Color(ReadableColor c)
Constructor for Color
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o)
Equals
|
void |
fromHSB(float hue,
float saturation,
float brightness)
HSB to RGB conversion, pinched from java.awt.Color.
|
int |
getAlpha()
Accessor
|
byte |
getAlphaByte()
Return the red component
|
int |
getBlue()
Accessor
|
byte |
getBlueByte()
Return the red component
|
int |
getGreen()
Accessor
|
byte |
getGreenByte()
Return the red component
|
int |
getRed()
Accessor
|
byte |
getRedByte()
Return the red component
|
int |
hashCode()
Hashcode
|
void |
readABGR(java.nio.ByteBuffer src)
Read a color from a byte buffer
|
void |
readARGB(java.nio.ByteBuffer src)
Read a color from a byte buffer
|
void |
readBGR(java.nio.ByteBuffer src)
Read a color from a byte buffer
|
void |
readBGRA(java.nio.ByteBuffer src)
Read a color from a byte buffer
|
void |
readRGB(java.nio.ByteBuffer src)
Read a color from a byte buffer
|
void |
readRGBA(java.nio.ByteBuffer src)
Read a color from a byte buffer
|
void |
set(byte r,
byte g,
byte b)
Set a color
|
void |
set(byte r,
byte g,
byte b,
byte a)
Set a color
|
void |
set(int r,
int g,
int b)
Set a color
|
void |
set(int r,
int g,
int b,
int a)
Set a color
|
void |
setAlpha(byte alpha)
Set the Alpha component
|
void |
setAlpha(int alpha)
Set the Alpha component
|
void |
setBlue(byte blue)
Set the Blue component
|
void |
setBlue(int blue)
Set the Blue component
|
void |
setColor(ReadableColor src)
Set this color's color by copying another color
|
void |
setGreen(byte green)
Set the Green component
|
void |
setGreen(int green)
Set the Green component
|
void |
setRed(byte red)
Set the Red component
|
void |
setRed(int red)
Set the Red component
|
float[] |
toHSB(float[] dest)
RGB to HSB conversion, pinched from java.awt.Color.
|
java.lang.String |
toString()
Stringify
|
void |
writeABGR(java.nio.ByteBuffer dest)
Write the ABGR color directly out to a ByteBuffer
|
void |
writeARGB(java.nio.ByteBuffer dest)
Write the ARGB color directly out to a ByteBuffer
|
void |
writeBGR(java.nio.ByteBuffer dest)
Write the BGR color directly out to a ByteBuffer
|
void |
writeBGRA(java.nio.ByteBuffer dest)
Write the BGRA color directly out to a ByteBuffer
|
void |
writeRGB(java.nio.ByteBuffer dest)
Write the RGB color directly out to a ByteBuffer
|
void |
writeRGBA(java.nio.ByteBuffer dest)
Write the RGBA color directly out to a ByteBuffer
|
public Color()
public Color(int r,
int g,
int b)
public Color(byte r,
byte g,
byte b)
public Color(int r,
int g,
int b,
int a)
public Color(byte r,
byte g,
byte b,
byte a)
public Color(ReadableColor c)
public void set(int r,
int g,
int b,
int a)
set in interface WritableColorpublic void set(byte r,
byte g,
byte b,
byte a)
set in interface WritableColorpublic void set(int r,
int g,
int b)
set in interface WritableColorpublic void set(byte r,
byte g,
byte b)
set in interface WritableColorpublic int getRed()
getRed in interface ReadableColorpublic int getGreen()
getGreen in interface ReadableColorpublic int getBlue()
getBlue in interface ReadableColorpublic int getAlpha()
getAlpha in interface ReadableColorpublic void setRed(int red)
setRed in interface WritableColorpublic void setGreen(int green)
setGreen in interface WritableColorpublic void setBlue(int blue)
setBlue in interface WritableColorpublic void setAlpha(int alpha)
setAlpha in interface WritableColorpublic void setRed(byte red)
setRed in interface WritableColorpublic void setGreen(byte green)
setGreen in interface WritableColorpublic void setBlue(byte blue)
setBlue in interface WritableColorpublic void setAlpha(byte alpha)
setAlpha in interface WritableColorpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic byte getAlphaByte()
ReadableColorgetAlphaByte in interface ReadableColorpublic byte getBlueByte()
ReadableColorgetBlueByte in interface ReadableColorpublic byte getGreenByte()
ReadableColorgetGreenByte in interface ReadableColorpublic byte getRedByte()
ReadableColorgetRedByte in interface ReadableColorpublic void writeRGBA(java.nio.ByteBuffer dest)
ReadableColorwriteRGBA in interface ReadableColordest - the buffer to write topublic void writeRGB(java.nio.ByteBuffer dest)
ReadableColorwriteRGB in interface ReadableColordest - the buffer to write topublic void writeABGR(java.nio.ByteBuffer dest)
ReadableColorwriteABGR in interface ReadableColordest - the buffer to write topublic void writeARGB(java.nio.ByteBuffer dest)
ReadableColorwriteARGB in interface ReadableColordest - the buffer to write topublic void writeBGR(java.nio.ByteBuffer dest)
ReadableColorwriteBGR in interface ReadableColordest - the buffer to write topublic void writeBGRA(java.nio.ByteBuffer dest)
ReadableColorwriteBGRA in interface ReadableColordest - the buffer to write topublic void readRGBA(java.nio.ByteBuffer src)
readRGBA in interface WritableColorsrc - The source bufferpublic void readRGB(java.nio.ByteBuffer src)
readRGB in interface WritableColorsrc - The source bufferpublic void readARGB(java.nio.ByteBuffer src)
readARGB in interface WritableColorsrc - The source bufferpublic void readBGRA(java.nio.ByteBuffer src)
readBGRA in interface WritableColorsrc - The source bufferpublic void readBGR(java.nio.ByteBuffer src)
readBGR in interface WritableColorsrc - The source bufferpublic void readABGR(java.nio.ByteBuffer src)
readABGR in interface WritableColorsrc - The source bufferpublic void setColor(ReadableColor src)
setColor in interface WritableColorsrc - The source colorpublic void fromHSB(float hue,
float saturation,
float brightness)
hue - (0..1.0f)saturation - (0..1.0f)brightness - (0..1.0f)public float[] toHSB(float[] dest)
dest - Destination floats, or nullCopyright © 2002-2009 lwjgl.org. All Rights Reserved.