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
ConstructorsConstructorDescriptionRGBColorWrapper(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.intblue()Value of color bluebooleanintgreen()Value of color greeninthashCode()static RGBColorWrapperCreate a newRGBColorWrapperbased on a hex string with RGBA or RGB.static RGBColorWrapperCreate a newRGBColorWrapperbased on aColor.intred()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 newRGBColorWrapperbased on aColor.- Parameters:
color- color instance- Returns:
- new
RGBColorWrapperinstance
-
of
Create a newRGBColorWrapperbased on a hex string with RGBA or RGB.- Parameters:
hex- color as hex string- Returns:
- new
RGBColorWrapperinstance
-
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
-