GizmoStyle .java

net.minecraft.gizmos.GizmoStyle (record): members: stroke, strokeWidth, fill, multipliedStroke, multipliedFill, strokeAndFill, hasStroke, hasFill.

net.minecraft.gizmosrecord40 linescommon1.0 KB

API Surface (9)

record GizmoStyle(int stroke, float strokeWidth, int fill)
GizmoStyle stroke(final int argb)
GizmoStyle stroke(final int argb, final float width)
GizmoStyle fill(final int argb)
GizmoStyle strokeAndFill(final int stroke, final float strokeWidth, final int fill)
boolean hasFill()
boolean hasStroke()
int multipliedStroke(final float alphaMultiplier)
int multipliedFill(final float alphaMultiplier)

Fields & Constants (1)

DEFAULT_WIDTH

Code Graph: Dependencies (1)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

GizmoStyle.java40 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.gizmos;
2
3
import net.minecraft.util.ARGB;
4
5
public record GizmoStyle(int stroke, float strokeWidth, int fill) {
6
	private static final float DEFAULT_WIDTH = 2.5F;
7
8
	public static GizmoStyle stroke(final int argb) {
9
		return new GizmoStyle(argb, 2.5F, 0);
10
	}
11
12
	public static GizmoStyle stroke(final int argb, final float width) {
13
		return new GizmoStyle(argb, width, 0);
14
	}
15
16
	public static GizmoStyle fill(final int argb) {
17
		return new GizmoStyle(0, 0.0F, argb);
18
	}
19
20
	public static GizmoStyle strokeAndFill(final int stroke, final float strokeWidth, final int fill) {
21
		return new GizmoStyle(stroke, strokeWidth, fill);
22
	}
23
24
	public boolean hasFill() {
25
		return this.fill != 0;
26
	}
27
28
	public boolean hasStroke() {
29
		return this.stroke != 0 && this.strokeWidth > 0.0F;
30
	}
31
32
	public int multipliedStroke(final float alphaMultiplier) {
33
		return ARGB.multiplyAlpha(this.stroke, alphaMultiplier);
34
	}
35
36
	public int multipliedFill(final float alphaMultiplier) {
37
		return ARGB.multiplyAlpha(this.fill, alphaMultiplier);
38
	}
39
}
40

Decompiled Minecraft 26.3 source of GizmoStyle (net/minecraft/gizmos/GizmoStyle.java) with Mojang official mappings, stored verbatim on the site.