From 4f6966b9002ae62197998c659a6ae0ec79f927b9 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Sun, 3 Mar 2019 23:57:28 -0800 Subject: [PATCH] Defined colors for item backgrounds --- core/src/gdx/diablo/Colors.java | 5 +++++ core/src/gdx/diablo/panel/InventoryPanel.java | 6 ++---- core/src/gdx/diablo/widget/ItemGrid.java | 12 ++++-------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/core/src/gdx/diablo/Colors.java b/core/src/gdx/diablo/Colors.java index 8a58e074..25da630d 100644 --- a/core/src/gdx/diablo/Colors.java +++ b/core/src/gdx/diablo/Colors.java @@ -34,6 +34,11 @@ public class Colors { public Color modal50 = new Color(0, 0, 0, 0.50f); public Color modal75 = new Color(0, 0, 0, 0.75f); + public Color invBlue = new Color(0.1f, 0.1f, 0.5f, 0.3f); + public Color invGreen = new Color(0.1f, 0.5f, 0.1f, 0.3f); + public Color invRed = new Color(0.5f, 0.1f, 0.1f, 0.3f); + public Color invWhite = new Color(0.5f, 0.5f, 0.5f, 0.3f); + public Colors() {} public void load() { diff --git a/core/src/gdx/diablo/panel/InventoryPanel.java b/core/src/gdx/diablo/panel/InventoryPanel.java index 041f320a..0316a868 100644 --- a/core/src/gdx/diablo/panel/InventoryPanel.java +++ b/core/src/gdx/diablo/panel/InventoryPanel.java @@ -81,10 +81,8 @@ public class InventoryPanel extends WidgetGroup implements Disposable { fill = new Texture(solidColorPixmap); solidColorPixmap.dispose(); - backgroundColorG = Color.GREEN.cpy(); - backgroundColorG.a = 0.25f; - backgroundColorR = Color.RED.cpy(); - backgroundColorR.a = 0.25f; + backgroundColorR = Diablo.colors.invRed; + backgroundColorG = Diablo.colors.invGreen; btnExit = new Button(new Button.ButtonStyle() {{ Diablo.assets.load(buysellbtnDescriptor); diff --git a/core/src/gdx/diablo/widget/ItemGrid.java b/core/src/gdx/diablo/widget/ItemGrid.java index 6fd6245b..479858d0 100644 --- a/core/src/gdx/diablo/widget/ItemGrid.java +++ b/core/src/gdx/diablo/widget/ItemGrid.java @@ -69,14 +69,10 @@ public class ItemGrid extends Group { fill = new Texture(solidColorPixmap); solidColorPixmap.dispose(); - backgroundColorR = Color.RED.cpy(); - backgroundColorR.a = 0.20f; - backgroundColorG = Color.GREEN.cpy(); - backgroundColorG.a = 0.20f; - backgroundColorB = Color.BLUE.cpy(); - backgroundColorB.a = 0.20f; - backgroundColorW = Color.WHITE.cpy(); - backgroundColorW.a = 0.20f; + backgroundColorR = Diablo.colors.invRed; + backgroundColorG = Diablo.colors.invGreen; + backgroundColorB = Diablo.colors.invBlue; + backgroundColorW = Diablo.colors.invWhite; setTouchable(Touchable.enabled); setSize(width * boxWidth, height * boxHeight);