Class RGBColorWrapper
java.lang.Object
de.eldoria.jacksonbukkit.entities.RGBColorWrapper
- Direct Known Subclasses:
RGBAColorWrapper
Class for wrapping a
Color
.
It also allows transformation to hex code and parsing of hex code.
-
Constructor Summary
ConstructorDescriptionRGBColorWrapper
(int red, int green, int blue) Create a new color wrapper for RGB colors -
Method Summary
Modifier and TypeMethodDescriptionasHex()
Get the string as hex string with RGBA.int
blue()
Value of color blueboolean
int
green()
Value of color greenint
hashCode()
static RGBColorWrapper
Create a newRGBColorWrapper
based on a hex string with RGBA or RGB.static RGBColorWrapper
Create a newRGBColorWrapper
based on aColor
.int
red()
Value of color redConstructs a new color instance based on wrapper values.toString()
-
Constructor Details
-
RGBColorWrapper
public RGBColorWrapper(int red, int green, int blue) Create a new color wrapper for RGB colors- Parameters:
red
- red valuegreen
- green valueblue
- blue value
-
-
Method Details
-
of
Create a newRGBColorWrapper
based on aColor
.- Parameters:
color
- color instance- Returns:
- new
RGBColorWrapper
instance
-
of
Create a newRGBColorWrapper
based on a hex string with RGBA or RGB.- Parameters:
hex
- color as hex string- Returns:
- new
RGBColorWrapper
instance
-
asHex
Get the string as hex string with RGBA.- Returns:
- hex color as RGBA
-
toBukkitColor
Constructs a new color instance based on wrapper values.- Returns:
- new color instance
-
red
public int red()Value of color red- Returns:
- red
-
green
public int green()Value of color green- Returns:
- green
-
blue
public int blue()Value of color blue- Returns:
- blue
-
equals
-
hashCode
public int hashCode() -
toString
-