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 bundle color.static final ColorKeyBlack shulker box color.static final ColorKeyBlue bundle color.static final ColorKeyBlue shulker box color.static final ColorKeyBrown bundle color.static final ColorKeyBrown shulker box color.static final ColorKeyBundle container color.static final ColorKeyCyan bundle color.static final ColorKeyCyan shulker box color.static final ColorKeyThe default inventory color.static final ColorKeyColor used by ender chest previews.static final ColorKeyGeneric container color.static final ColorKeyGray bundle color.static final ColorKeyGray shulker box color.static final ColorKeyGreen bundle color.static final ColorKeyGreen shulker box color.static final ColorKeyLight blue bundle color.static final ColorKeyLight blue shulker box color.static final ColorKeyLight gray bundle color.static final ColorKeyLight gray shulker box color.static final ColorKeyLime bundle color.static final ColorKeyLime shulker box color.static final ColorKeyMagenta bundle color.static final ColorKeyMagenta shulker box color.static final ColorKeyOrange bundle color.static final ColorKeyOrange shulker box color.static final ColorKeyPink bundle color.static final ColorKeyPink shulker box color.static final ColorKeyPurple bundle color.static final ColorKeyPurple shulker box color.static final ColorKeyRed bundle color.static final ColorKeyRed shulker box color.static final ColorKeyUndyed shulker box color.static final ColorKeyWhite bundle color.static final ColorKeyWhite shulker box color.static final ColorKeyYellow bundle 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. -
GENERIC_CONTAINER
Generic container color. -
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. -
BUNDLE
Bundle container color. -
WHITE_BUNDLE
White bundle color. -
ORANGE_BUNDLE
Orange bundle color. -
MAGENTA_BUNDLE
Magenta bundle color. -
LIGHT_BLUE_BUNDLE
Light blue bundle color. -
YELLOW_BUNDLE
Yellow bundle color. -
LIME_BUNDLE
Lime bundle color. -
PINK_BUNDLE
Pink bundle color. -
GRAY_BUNDLE
Gray bundle color. -
LIGHT_GRAY_BUNDLE
Light gray bundle color. -
CYAN_BUNDLE
Cyan bundle color. -
PURPLE_BUNDLE
Purple bundle color. -
BLUE_BUNDLE
Blue bundle color. -
BROWN_BUNDLE
Brown bundle color. -
GREEN_BUNDLE
Green bundle color. -
RED_BUNDLE
Red bundle color. -
BLACK_BUNDLE
Black bundle 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
-
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
-