package dev.crucifixbeta.mod.gui;

import dev.crucifixbeta.api.utils.render.Render2DUtil;
import java.awt.Color;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.DrawContext;

@Environment(EnvType.CLIENT)
public final class ScreenBackgroundRenderer {
   private ScreenBackgroundRenderer() {
   }

   public static void render(DrawContext context, int width, int height) {
      renderAcrylic(context, width, height, 1.0F);
   }

   public static void renderAcrylic(DrawContext context, int width, int height, float alpha) {
      int var4 = Math.round(34.0F * alpha);
      int var5 = Math.round(52.0F * alpha);
      int var6 = Math.round(26.0F * alpha);
      Render2DUtil.verticalGradient(
         context.getMatrices(), 0.0F, 0.0F, (float)width, (float)height, new Color(232, 242, 255, var4), new Color(176, 166, 232, var5)
      );
      Render2DUtil.horizontalGradient(
         context.getMatrices(), 0.0F, 0.0F, (float)width, (float)height, new Color(130, 185, 255, var6), new Color(236, 226, 255, var6)
      );
      Render2DUtil.drawRect(context.getMatrices(), 0.0F, 0.0F, (float)width, (float)height, new Color(255, 255, 255, Math.round(18.0F * alpha)));
   }
}
