]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blob - src/main/java/com/irtimaled/bbor/client/gui/BoundingBoxTypeButton.java
5c85899fe01cc0a6eaba3755f28b21d7f035d293
[BoundingBoxOutlineReloaded.git] / src / main / java / com / irtimaled / bbor / client / gui / BoundingBoxTypeButton.java
1 package com.irtimaled.bbor.client.gui;
2
3 import com.irtimaled.bbor.common.BoundingBoxType;
4
5 import java.awt.*;
6
7 public class BoundingBoxTypeButton extends BoolSettingButton {
8     private final Color color;
9
10     BoundingBoxTypeButton(int width, String label, BoundingBoxType type) {
11         super(width, label, type.shouldRenderSetting);
12         color = type.getColor();
13     }
14
15     @Override
16     protected void renderBackground(int mouseX, int mouseY) {
17         int left = x + 1;
18         int top = y + 1;
19         int right = left + width - 2;
20         int bottom = top + height - 2;
21
22         // top & left
23         drawRectangle(left, top, right, top + 1, color);
24         drawRectangle(left, top, left + 1, bottom, color);
25
26         Color darker = color.darker();
27         // bottom left & top right
28         drawRectangle(left, bottom - 2, left + 1, bottom, darker);
29         drawRectangle(right - 1, top, right, top + 1, darker);
30
31         Color darkest = darker.darker();
32         // bottom & right
33         drawRectangle(left + 1, bottom - 2, right, bottom, darkest);
34         drawRectangle(right - 1, top + 1, right, bottom, darkest);
35     }
36 }