Klasse ColorPickerWidget
java.lang.Object
schrumbo.schrumbohud.clickgui.widgets.Widget
schrumbo.schrumbohud.clickgui.widgets.ColorPickerWidget
Inline color picker with HSV controls and opacity slider
-
Verschachtelte Klassen - Übersicht
Verschachtelte Klassen -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprivate final net.minecraft.client.MinecraftClientprivate final HudConfigprivate static final intprivate booleanprivate booleanprivate booleanprivate final booleanprivate floatprivate floatprivate floatprivate static final intprivate static final intprivate static final intprivate float -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprivate voidstatic ColorPickerWidget.Builderbuilder()private static inthsvToRgb(float h, float s, float v) private booleanisHoveringSlider(double mouseX, double mouseY, int sx, int sy, int width, int height) private intlerpColor(int from, int to, float t) booleanmouseClicked(double mouseX, double mouseY, int button) booleanmouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) booleanmouseReleased(double mouseX, double mouseY, int button) voidrender(net.minecraft.client.gui.DrawContext context, int mouseX, int mouseY, float delta) private voidrenderHueSlider(net.minecraft.client.gui.DrawContext context, int sx, int sy, int mouseX, int mouseY) private voidrenderOpacitySlider(net.minecraft.client.gui.DrawContext context, int sx, int sy, int mouseX, int mouseY) private voidrenderSliderHandle(net.minecraft.client.gui.DrawContext context, int x, int y, int width, boolean hovered) private voidrenderSVPicker(net.minecraft.client.gui.DrawContext context, int px, int py, int mouseX, int mouseY) private static float[]rgbToHsv(int rgb) private voidprivate voidupdateHueFromMouse(double mouseY, int contentY) private voidupdateOpacityFromMouse(double mouseY, int contentY) private voidupdateSVFromMouse(double mouseX, double mouseY, int pickerX, int contentY) Von Klasse geerbte Methoden schrumbo.schrumbohud.clickgui.widgets.Widget
getHeight, isHovered, keyPressed, setPosition
-
Felddetails
-
colorGetter
-
colorSetter
-
opacityGetter
-
opacitySetter
-
hasOpacityControl
private final boolean hasOpacityControl -
client
private final net.minecraft.client.MinecraftClient client -
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
-
ColorPickerWidget
-
-
Methodendetails
-
render
public void render(net.minecraft.client.gui.DrawContext context, int mouseX, int mouseY, float delta) -
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:
mouseClickedin KlasseWidget
-
mouseDragged
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) - Setzt außer Kraft:
mouseDraggedin KlasseWidget
-
mouseReleased
public boolean mouseReleased(double mouseX, double mouseY, int button) - Angegeben von:
mouseReleasedin KlasseWidget
-
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
-