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 WritableColor
public void set(byte r, byte g, byte b, byte a)
set
in interface WritableColor
public void set(int r, int g, int b)
set
in interface WritableColor
public void set(byte r, byte g, byte b)
set
in interface WritableColor
public int getRed()
getRed
in interface ReadableColor
public int getGreen()
getGreen
in interface ReadableColor
public int getBlue()
getBlue
in interface ReadableColor
public int getAlpha()
getAlpha
in interface ReadableColor
public void setRed(int red)
setRed
in interface WritableColor
public void setGreen(int green)
setGreen
in interface WritableColor
public void setBlue(int blue)
setBlue
in interface WritableColor
public void setAlpha(int alpha)
setAlpha
in interface WritableColor
public void setRed(byte red)
setRed
in interface WritableColor
public void setGreen(byte green)
setGreen
in interface WritableColor
public void setBlue(byte blue)
setBlue
in interface WritableColor
public void setAlpha(byte alpha)
setAlpha
in interface WritableColor
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public byte getAlphaByte()
ReadableColor
getAlphaByte
in interface ReadableColor
public byte getBlueByte()
ReadableColor
getBlueByte
in interface ReadableColor
public byte getGreenByte()
ReadableColor
getGreenByte
in interface ReadableColor
public byte getRedByte()
ReadableColor
getRedByte
in interface ReadableColor
public void writeRGBA(java.nio.ByteBuffer dest)
ReadableColor
writeRGBA
in interface ReadableColor
dest
- the buffer to write topublic void writeRGB(java.nio.ByteBuffer dest)
ReadableColor
writeRGB
in interface ReadableColor
dest
- the buffer to write topublic void writeABGR(java.nio.ByteBuffer dest)
ReadableColor
writeABGR
in interface ReadableColor
dest
- the buffer to write topublic void writeARGB(java.nio.ByteBuffer dest)
ReadableColor
writeARGB
in interface ReadableColor
dest
- the buffer to write topublic void writeBGR(java.nio.ByteBuffer dest)
ReadableColor
writeBGR
in interface ReadableColor
dest
- the buffer to write topublic void writeBGRA(java.nio.ByteBuffer dest)
ReadableColor
writeBGRA
in interface ReadableColor
dest
- the buffer to write topublic void readRGBA(java.nio.ByteBuffer src)
readRGBA
in interface WritableColor
src
- The source bufferpublic void readRGB(java.nio.ByteBuffer src)
readRGB
in interface WritableColor
src
- The source bufferpublic void readARGB(java.nio.ByteBuffer src)
readARGB
in interface WritableColor
src
- The source bufferpublic void readBGRA(java.nio.ByteBuffer src)
readBGRA
in interface WritableColor
src
- The source bufferpublic void readBGR(java.nio.ByteBuffer src)
readBGR
in interface WritableColor
src
- The source bufferpublic void readABGR(java.nio.ByteBuffer src)
readABGR
in interface WritableColor
src
- The source bufferpublic void setColor(ReadableColor src)
setColor
in interface WritableColor
src
- 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.