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 class net.minecraft.client.gui.components.AbstractWidget

    net.minecraft.client.gui.components.AbstractWidget.WithInactiveMessage

    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 color picker widget
    static final int
    The width of a color picker widget

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

    active, alpha, height, isHovered, message, packedFGColor, tooltip, UNSET_FG_COLOR, visible, width
  • 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.
    void
    extractWidgetContent(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int mouseX, int mouseY, float partialTicks)
     
    net.minecraft.network.chat.TextColor
    Gets the current value of the color picker.
    boolean
    mouseClicked(net.minecraft.client.input.MouseButtonEvent event, boolean isDoubleClick)
     
    boolean
    mouseDragged(net.minecraft.client.input.MouseButtonEvent event, double dragX, double dragY)
     
    void
    setColor(net.minecraft.network.chat.TextColor color)
    Sets the current value of the color picker.
    void
    setResponder(Consumer<net.minecraft.network.chat.TextColor> responder)
    Sets a responder that is notified whenever the color changes.

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

    clearFGColor, createNarrationMessage, defaultButtonNarrationText, extractRenderState, extractScrollingStringOverContents, getAlpha, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, handleCursor, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, narrationPriority, onClick, onDrag, onRelease, playButtonClickSound, playDownSound, setAlpha, setFGColor, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessage

    Methods inherited from class Object

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

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

    getBorderForArrowNavigation, isFocused, preeditUpdated

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

    getRectangle, isMouseOver, mouseMoved, shouldTakeFocusAfterInteraction

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

    setPosition

    Methods inherited from interface net.minecraft.client.gui.narration.NarratableEntry

    getNarratables

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

    getTabOrderGroup
  • Field Details

    • WIDTH

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

      public static final int HEIGHT
      The height of a color 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 color picker.
    • setColor

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

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

      public void extractWidgetContent(@Nonnull net.minecraft.client.gui.GuiGraphicsExtractor graphics, int mouseX, int mouseY, float partialTicks)
      Overrides:
      extractWidgetContent in class Panel
    • mouseClicked

      public boolean mouseClicked(net.minecraft.client.input.MouseButtonEvent event, boolean isDoubleClick)
      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(net.minecraft.client.input.MouseButtonEvent event, 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