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

Method drawGradientRect

Minecraft-Utils/1.13/src/GuiHandle.java:211–245  ·  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

209 }
210
211 public static void drawGradientRect(double left, double top, double right, double bottom, int startColor, int endColor, boolean vertical) {
212 float a1 = (float) (startColor >> 24 & 255) / 255.0F;
213 float r1 = (float) (startColor >> 16 & 255) / 255.0F;
214 float g1 = (float) (startColor >> 8 & 255) / 255.0F;
215 float b1 = (float) (startColor & 255) / 255.0F;
216 float a2 = (float) (endColor >> 24 & 255) / 255.0F;
217 float r2 = (float) (endColor >> 16 & 255) / 255.0F;
218 float g2 = (float) (endColor >> 8 & 255) / 255.0F;
219 float b2 = (float) (endColor & 255) / 255.0F;
220
221 ctp.z();
222 GLUtil.enableBlend();
223 GLUtil.disableAlpha();
224 ctp.a(ctp.r.l, ctp.l.j, ctp.r.e, ctp.l.n);
225 ctp.j(7425);
226 cub tesselator = cub.a();
227 ctf vertex = tesselator.c();
228 vertex.a(7, ddk.m);
229 if (!vertical) {
230 vertex.b(right, top, 1.0).a(r1, g1, b1, a1).d();
231 vertex.b(left, top, 1.0).a(r1, g1, b1, a1).d();
232 vertex.b(left, bottom, 1.0).a(r2, g2, b2, a2).d();
233 vertex.b(right, bottom, 1.0).a(r2, g2, b2, a2).d();
234 } else {
235 vertex.b(right, top, 1.0).a(r2, g2, b2, a2).d();
236 vertex.b(left, top, 1.0).a(r1, g1, b1, a1).d();
237 vertex.b(left, bottom, 1.0).a(r1, g1, b1, a1).d();
238 vertex.b(right, bottom, 1.0).a(r2, g2, b2, a2).d();
239 }
240 tesselator.b();
241 ctp.j(7424);
242 GLUtil.disableBlend();
243 ctp.e();
244 ctp.y();
245 }
246
247 public Gui getChild() {
248 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