MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / drawGradientRect

Method drawGradientRect

Minecraft-Utils/1.12.2/src/GuiHandle.java:191–225  ·  view source on GitHub ↗
(double left, double top, double right, double bottom, int startColor, int endColor, boolean vertical)

Source from the content-addressed store, hash-verified

189 }
190
191 public static void drawGradientRect(double left, double top, double right, double bottom, int startColor, int endColor, boolean vertical) {
192 float a1 = (float) (startColor >> 24 & 255) / 255.0F;
193 float r1 = (float) (startColor >> 16 & 255) / 255.0F;
194 float g1 = (float) (startColor >> 8 & 255) / 255.0F;
195 float b1 = (float) (startColor & 255) / 255.0F;
196 float a2 = (float) (endColor >> 24 & 255) / 255.0F;
197 float r2 = (float) (endColor >> 16 & 255) / 255.0F;
198 float g2 = (float) (endColor >> 8 & 255) / 255.0F;
199 float b2 = (float) (endColor & 255) / 255.0F;
200
201 bus.z();
202 GLUtil.enableBlend();
203 GLUtil.disableAlpha();
204 bus.a(bus.r.l, bus.l.j, bus.r.e, bus.l.n);
205 bus.j(7425);
206 bve tesselator = bve.a();
207 buk vertex = tesselator.c();
208 vertex.a(7, cdy.f);
209 if (!vertical) {
210 vertex.b(right, top, 1.0).a(r1, g1, b1, a1).d();
211 vertex.b(left, top, 1.0).a(r1, g1, b1, a1).d();
212 vertex.b(left, bottom, 1.0).a(r2, g2, b2, a2).d();
213 vertex.b(right, bottom, 1.0).a(r2, g2, b2, a2).d();
214 } else {
215 vertex.b(right, top, 1.0).a(r2, g2, b2, a2).d();
216 vertex.b(left, top, 1.0).a(r1, g1, b1, a1).d();
217 vertex.b(left, bottom, 1.0).a(r1, g1, b1, a1).d();
218 vertex.b(right, bottom, 1.0).a(r2, g2, b2, a2).d();
219 }
220 tesselator.b();
221 bus.j(7424);
222 GLUtil.disableBlend();
223 bus.e();
224 bus.y();
225 }
226
227 public Gui getChild() {
228 return child;

Callers

nothing calls this directly

Calls 8

enableBlendMethod · 0.95
disableAlphaMethod · 0.95
disableBlendMethod · 0.95
aMethod · 0.45
cMethod · 0.45
dMethod · 0.45
bMethod · 0.45
eMethod · 0.45

Tested by

no test coverage detected