Class ColorPicker

java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
org.moddingx.libx.screen.Panel
org.moddingx.libx.screen.ColorPicker
All Implemented Interfaces:
net.minecraft.client.gui.components.events.ContainerEventHandler, net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.Renderable, net.minecraft.client.gui.components.TabOrderedElement, net.minecraft.client.gui.layouts.LayoutElement, net.minecraft.client.gui.narration.NarratableEntry, net.minecraft.client.gui.narration.NarrationSupplier, EditorOps

public class ColorPicker extends Panel
A widget that lets a user select a colour.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry

    net.minecraft.client.gui.narration.NarratableEntry.NarrationPriority
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The height of a colour picker widget
    static final int
    The width of a colour picker widget

    Fields inherited from class net.minecraft.client.gui.components.AbstractWidget

    ACCESSIBILITY_TEXTURE, active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, WIDGETS_LOCATION, width

    Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    DOUBLE_CLICK_THRESHOLD_MS
  • Constructor Summary

    Constructors
    Constructor
    Description
    ColorPicker(int x, int y)
     
    ColorPicker(int x, int y, ColorPicker old)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    enabled(boolean enabled)
    Marks a widget as enabled or disabled.
    net.minecraft.network.chat.TextColor
    Gets the current value of the colour picker.
    boolean
    mouseClicked(double mouseX, double mouseY, int button)
     
    boolean
    mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY)
     
    void
    render(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks)
     
    void
    setColor(net.minecraft.network.chat.TextColor color)
    Sets the current value of the colour picker.
    void
    setResponder(Consumer<net.minecraft.network.chat.TextColor> responder)
    Sets a responder that is notified whenever the colour changes.

    Methods inherited from class net.minecraft.client.gui.components.AbstractWidget

    clearFGColor, clicked, createNarrationMessage, createTooltipPositioner, defaultButtonNarrationText, getFGColor, getHeight, getMessage, getRectangle, getTabOrderGroup, getTooltip, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, narrationPriority, onClick, onDrag, onRelease, playDownSound, renderScrollingString, renderScrollingString, renderTexture, setAlpha, setFGColor, setHeight, setMessage, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessage

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler

    isFocused, magicalSpecialHackyFocus

    Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    getRectangle, isMouseOver, mouseMoved

    Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement

    setPosition

    Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement

    getTabOrderGroup
  • Field Details

    • WIDTH

      public static final int WIDTH
      The width of a colour picker widget
      See Also:
    • HEIGHT

      public static final int HEIGHT
      The height of a colour picker widget
      See Also:
  • Constructor Details

    • ColorPicker

      public ColorPicker(int x, int y)
    • ColorPicker

      public ColorPicker(int x, int y, @Nullable ColorPicker old)
  • Method Details

    • getColor

      public net.minecraft.network.chat.TextColor getColor()
      Gets the current value of the colour picker.
    • setColor

      public void setColor(net.minecraft.network.chat.TextColor color)
      Sets the current value of the colour picker.
    • setResponder

      public void setResponder(@Nullable Consumer<net.minecraft.network.chat.TextColor> responder)
      Sets a responder that is notified whenever the colour changes.
    • render

      public void render(@Nonnull net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks)
      Specified by:
      render in interface net.minecraft.client.gui.components.Renderable
      Overrides:
      render in class net.minecraft.client.gui.components.AbstractWidget
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button)
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseClicked in class Panel
    • mouseDragged

      public boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY)
      Specified by:
      mouseDragged in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseDragged in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseDragged in class Panel
    • enabled

      public void enabled(boolean enabled)
      Description copied from interface: EditorOps
      Marks a widget as enabled or disabled.
      Specified by:
      enabled in interface EditorOps
      Overrides:
      enabled in class Panel