package dev.crucifixbeta.mod.gui.epsilon;

import dev.crucifixbeta.mod.modules.impl.client.ClickGui;
import dev.crucifixbeta.mod.modules.impl.client.ColorsModule;
import java.awt.Color;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

@Environment(EnvType.CLIENT)
public final class EpsilonTheme {
   public static final float PANEL_W = 76.0F;
   public static final float PANEL_HDR = 22.0F;
   public static final float PANEL_RAD = 6.0F;
   public static final float MODULE_H = 16.0F;
   public static Color PANEL_BG = new Color(248, 248, 250, 230);
   public static Color HEADER_BG = new Color(235, 238, 244, 238);
   public static Color MODULE_BG = new Color(244, 247, 255, 188);
   public static Color MODULE_HOVER = new Color(226, 232, 255, 155);
   public static Color MODULE_TOGGLE = new Color(184, 194, 255, 235);
   public static Color ACCENT = new Color(166, 188, 255);
   public static Color TEXT = new Color(102, 113, 165);
   public static Color TEXT_ON = Color.WHITE;

   private EpsilonTheme() {
   }

   public static float guiScale() {
      return 1.0F;
   }

   public static float panelW() {
      return 76.0F;
   }

   public static float panelHdr() {
      return 22.0F;
   }

   public static float moduleH() {
      return 16.0F;
   }

   public static void syncFromColors() {
      ColorsModule var0 = ColorsModule.INSTANCE;
      if (var0 != null) {
         ClickGui var1 = ClickGui.getInstance();
         Color var2 = var1 != null ? var1.getActiveColor() : var0.accent.getValue();
         PANEL_BG = var0.panelBg.getValue();
         HEADER_BG = var0.headerBg.getValue();
         MODULE_BG = var0.moduleBg.getValue();
         MODULE_HOVER = var0.moduleHover.getValue();
         MODULE_TOGGLE = alpha(var2, var0.moduleBgOn.getValue().getAlpha());
         ACCENT = alpha(var2, var0.accent.getValue().getAlpha());
         TEXT = var0.moduleText.getValue();
         TEXT_ON = var0.moduleTextOn.getValue();
      }
   }

   private static Color alpha(Color color, int alpha) {
      return new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha);
   }
}
