Interface ColorKey
@NonExtendable
@Environment(CLIENT)
public interface ColorKey
Player-customizable colors.
Once registered using the ColorRegistry instance given in ShulkerBoxTooltipApi.registerColors(ColorRegistry)
these will appear inside ShulkerBoxTooltip's configuration menu and file.
- Since:
- 3.2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ColorKeyBlack shulker box color.static final ColorKeyBlue shulker box color.static final ColorKeyBrown shulker box color.static final ColorKeyCyan shulker box color.static final ColorKeyThe default inventory color.static final ColorKeyColor used by ender chest previews.static final ColorKeyGray shulker box color.static final ColorKeyGreen shulker box color.static final ColorKeyLight blue shulker box color.static final ColorKeyLight gray shulker box color.static final ColorKeyLime shulker box color.static final ColorKeyMagenta shulker box color.static final ColorKeyOrange shulker box color.static final ColorKeyPink shulker box color.static final ColorKeyPurple shulker box color.static final ColorKeyRed shulker box color.static final ColorKeyUndyed shulker box color.static final ColorKeyWhite shulker box color.static final ColorKeyYellow shulker box color. -
Method Summary
Modifier and TypeMethodDescriptionstatic ColorKeyCreates aColorKeyinstance from an existing one.intGets the default value of this color key.float[]Gets the default value of this color key.static ColorKeyofRgb(float[] rgb) Creates aColorKeyinstance from three float RGB components, each channel can have values ranging from 0 to 1 (inclusive).static ColorKeyofRgb(int rgb) Creates aColorKeyinstance from an RGB integer.intrgb()Gets the value of this color key.float[]Gets the value of this color key.voidsetRgb(float[] rgb) Changes the color of this key using three RGB float component.voidsetRgb(int rgb) Changes the color of this key using an RGB-encoded integer.
-
Field Details
-
DEFAULT
The default inventory color. -
ENDER_CHEST
Color used by ender chest previews. -
SHULKER_BOX
Undyed shulker box color. -
WHITE_SHULKER_BOX
White shulker box color. -
ORANGE_SHULKER_BOX
Orange shulker box color. -
MAGENTA_SHULKER_BOX
Magenta shulker box color. -
LIGHT_BLUE_SHULKER_BOX
Light blue shulker box color. -
YELLOW_SHULKER_BOX
Yellow shulker box color. -
LIME_SHULKER_BOX
Lime shulker box color. -
PINK_SHULKER_BOX
Pink shulker box color. -
GRAY_SHULKER_BOX
Gray shulker box color. -
LIGHT_GRAY_SHULKER_BOX
Light gray shulker box color. -
CYAN_SHULKER_BOX
Cyan shulker box color. -
PURPLE_SHULKER_BOX
Purple shulker box color. -
BLUE_SHULKER_BOX
Blue shulker box color. -
BROWN_SHULKER_BOX
Brown shulker box color. -
GREEN_SHULKER_BOX
Green shulker box color. -
RED_SHULKER_BOX
Red shulker box color. -
BLACK_SHULKER_BOX
Black shulker box color.
-
-
Method Details
-
rgb
int rgb()Gets the value of this color key.- Returns:
- The value of this key as an RGB-encoded integer.
- Since:
- 3.2.0
-
rgbComponents
float[] rgbComponents()Gets the value of this color key.- Returns:
- The value of this key as an array of three RGB float components.
- Since:
- 3.2.0
-
defaultRgb
int defaultRgb()Gets the default value of this color key.- Returns:
- The default value of this key as an RGB-encoded integer.
- Since:
- 3.2.0
-
defaultRgbComponents
float[] defaultRgbComponents()Gets the default value of this color key.- Returns:
- The default value of this key as an array of three RGB float components.
- Since:
- 3.2.0
-
setRgb
void setRgb(int rgb) Changes the color of this key using an RGB-encoded integer.- Parameters:
rgb- An ARGB integer, the alpha channel is ignored.- Since:
- 3.2.0
-
setRgb
void setRgb(float[] rgb) Changes the color of this key using three RGB float component.- Parameters:
rgb- An array of three color channels, each value must range between 0 and 1 (inclusive).- Since:
- 3.2.0
-
copyOf
Creates aColorKeyinstance from an existing one.Modifications to the existing instance will not affect the new one and vice-versa.
- Parameters:
original- The instance to copy.- Returns:
- A new
ColorKeyinstance. - Since:
- 3.2.0
-
ofRgb
Creates aColorKeyinstance from three float RGB components, each channel can have values ranging from 0 to 1 (inclusive).- Parameters:
rgb- The color components.- Returns:
- A new
ColorKeyinstance. - Throws:
ArrayIndexOutOfBoundsException- When the components array is too short.- Since:
- 3.2.0
-
ofRgb
Creates aColorKeyinstance from an RGB integer.- Parameters:
rgb- An ARGB-encoded integer, the value of the alpha channel is ignored.- Returns:
- A new
ColorKeyinstance. - Since:
- 3.2.0
-