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 Details

    • DEFAULT

      static final ColorKey DEFAULT
      The default inventory color.
    • ENDER_CHEST

      static final ColorKey ENDER_CHEST
      Color used by ender chest previews.
    • GENERIC_CONTAINER

      static final ColorKey GENERIC_CONTAINER
      Generic container color.
    • SHULKER_BOX

      static final ColorKey SHULKER_BOX
      Undyed shulker box color.
    • WHITE_SHULKER_BOX

      static final ColorKey WHITE_SHULKER_BOX
      White shulker box color.
    • ORANGE_SHULKER_BOX

      static final ColorKey ORANGE_SHULKER_BOX
      Orange shulker box color.
    • MAGENTA_SHULKER_BOX

      static final ColorKey MAGENTA_SHULKER_BOX
      Magenta shulker box color.
    • LIGHT_BLUE_SHULKER_BOX

      static final ColorKey LIGHT_BLUE_SHULKER_BOX
      Light blue shulker box color.
    • YELLOW_SHULKER_BOX

      static final ColorKey YELLOW_SHULKER_BOX
      Yellow shulker box color.
    • LIME_SHULKER_BOX

      static final ColorKey LIME_SHULKER_BOX
      Lime shulker box color.
    • PINK_SHULKER_BOX

      static final ColorKey PINK_SHULKER_BOX
      Pink shulker box color.
    • GRAY_SHULKER_BOX

      static final ColorKey GRAY_SHULKER_BOX
      Gray shulker box color.
    • LIGHT_GRAY_SHULKER_BOX

      static final ColorKey LIGHT_GRAY_SHULKER_BOX
      Light gray shulker box color.
    • CYAN_SHULKER_BOX

      static final ColorKey CYAN_SHULKER_BOX
      Cyan shulker box color.
    • PURPLE_SHULKER_BOX

      static final ColorKey PURPLE_SHULKER_BOX
      Purple shulker box color.
    • BLUE_SHULKER_BOX

      static final ColorKey BLUE_SHULKER_BOX
      Blue shulker box color.
    • BROWN_SHULKER_BOX

      static final ColorKey BROWN_SHULKER_BOX
      Brown shulker box color.
    • GREEN_SHULKER_BOX

      static final ColorKey GREEN_SHULKER_BOX
      Green shulker box color.
    • RED_SHULKER_BOX

      static final ColorKey RED_SHULKER_BOX
      Red shulker box color.
    • BLACK_SHULKER_BOX

      static final ColorKey BLACK_SHULKER_BOX
      Black shulker box color.
    • BUNDLE

      static final ColorKey BUNDLE
      Bundle container color.
    • WHITE_BUNDLE

      static final ColorKey WHITE_BUNDLE
      White bundle color.
    • ORANGE_BUNDLE

      static final ColorKey ORANGE_BUNDLE
      Orange bundle color.
    • MAGENTA_BUNDLE

      static final ColorKey MAGENTA_BUNDLE
      Magenta bundle color.
    • LIGHT_BLUE_BUNDLE

      static final ColorKey LIGHT_BLUE_BUNDLE
      Light blue bundle color.
    • YELLOW_BUNDLE

      static final ColorKey YELLOW_BUNDLE
      Yellow bundle color.
    • LIME_BUNDLE

      static final ColorKey LIME_BUNDLE
      Lime bundle color.
    • PINK_BUNDLE

      static final ColorKey PINK_BUNDLE
      Pink bundle color.
    • GRAY_BUNDLE

      static final ColorKey GRAY_BUNDLE
      Gray bundle color.
    • LIGHT_GRAY_BUNDLE

      static final ColorKey LIGHT_GRAY_BUNDLE
      Light gray bundle color.
    • CYAN_BUNDLE

      static final ColorKey CYAN_BUNDLE
      Cyan bundle color.
    • PURPLE_BUNDLE

      static final ColorKey PURPLE_BUNDLE
      Purple bundle color.
    • BLUE_BUNDLE

      static final ColorKey BLUE_BUNDLE
      Blue bundle color.
    • BROWN_BUNDLE

      static final ColorKey BROWN_BUNDLE
      Brown bundle color.
    • GREEN_BUNDLE

      static final ColorKey GREEN_BUNDLE
      Green bundle color.
    • RED_BUNDLE

      static final ColorKey RED_BUNDLE
      Red bundle color.
    • BLACK_BUNDLE

      static final ColorKey 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

      static ColorKey copyOf(ColorKey original)
      Creates a ColorKey instance 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 ColorKey instance.
      Since:
      3.2.0
    • ofRgb

      static ColorKey ofRgb(float[] rgb)
      Creates a ColorKey instance from three float RGB components, each channel can have values ranging from 0 to 1 (inclusive).
      Parameters:
      rgb - The color components.
      Returns:
      A new ColorKey instance.
      Throws:
      ArrayIndexOutOfBoundsException - When the components array is too short.
      Since:
      3.2.0
    • ofRgb

      static ColorKey ofRgb(int rgb)
      Creates a ColorKey instance from an RGB integer.
      Parameters:
      rgb - An ARGB-encoded integer, the value of the alpha channel is ignored.
      Returns:
      A new ColorKey instance.
      Since:
      3.2.0