Klasse ColorPickerWidget

java.lang.Object
schrumbo.schrumbohud.clickgui.widgets.Widget
schrumbo.schrumbohud.clickgui.widgets.ColorPickerWidget

public class ColorPickerWidget extends Widget
Inline color picker with HSV controls and opacity slider
  • Felddetails

    • colorGetter

      private final Supplier<Integer> colorGetter
    • colorSetter

      private final Consumer<Integer> colorSetter
    • opacityGetter

      private final Supplier<Float> opacityGetter
    • opacitySetter

      private final Consumer<Float> opacitySetter
    • hasOpacityControl

      private final boolean hasOpacityControl
    • client

      private final net.minecraft.client.MinecraftClient client
    • config

      private final HudConfig config
    • hue

      private float hue
    • saturation

      private float saturation
    • value

      private float value
    • opacity

      private float opacity
    • draggingSV

      private boolean draggingSV
    • draggingHue

      private boolean draggingHue
    • draggingOpacity

      private boolean draggingOpacity
    • SV_PICKER_SIZE

      private static final int SV_PICKER_SIZE
      Siehe auch:
    • SLIDER_WIDTH

      private static final int SLIDER_WIDTH
      Siehe auch:
    • SLIDER_SPACING

      private static final int SLIDER_SPACING
      Siehe auch:
    • CONTENT_PADDING

      private static final int CONTENT_PADDING
      Siehe auch:
  • Konstruktordetails

  • Methodendetails

    • render

      public void render(net.minecraft.client.gui.DrawContext context, int mouseX, int mouseY, float delta)
      Angegeben von:
      render in Klasse Widget
    • renderSVPicker

      private void renderSVPicker(net.minecraft.client.gui.DrawContext context, int px, int py, int mouseX, int mouseY)
    • renderHueSlider

      private void renderHueSlider(net.minecraft.client.gui.DrawContext context, int sx, int sy, int mouseX, int mouseY)
    • renderOpacitySlider

      private void renderOpacitySlider(net.minecraft.client.gui.DrawContext context, int sx, int sy, int mouseX, int mouseY)
    • renderSliderHandle

      private void renderSliderHandle(net.minecraft.client.gui.DrawContext context, int x, int y, int width, boolean hovered)
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button)
      Angegeben von:
      mouseClicked in Klasse Widget
    • mouseDragged

      public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)
      Setzt außer Kraft:
      mouseDragged in Klasse Widget
    • mouseReleased

      public boolean mouseReleased(double mouseX, double mouseY, int button)
      Angegeben von:
      mouseReleased in Klasse Widget
    • updateSVFromMouse

      private void updateSVFromMouse(double mouseX, double mouseY, int pickerX, int contentY)
    • updateHueFromMouse

      private void updateHueFromMouse(double mouseY, int contentY)
    • updateOpacityFromMouse

      private void updateOpacityFromMouse(double mouseY, int contentY)
    • applyColor

      private void applyColor()
    • syncFromConfig

      private void syncFromConfig()
    • isHoveringSlider

      private boolean isHoveringSlider(double mouseX, double mouseY, int sx, int sy, int width, int height)
    • rgbToHsv

      private static float[] rgbToHsv(int rgb)
    • hsvToRgb

      private static int hsvToRgb(float h, float s, float v)
    • lerpColor

      private int lerpColor(int from, int to, float t)
    • builder

      public static ColorPickerWidget.Builder builder()