From b6b001cad08cb740e7a0ea87674183c732fdc3a1 Mon Sep 17 00:00:00 2001 From: Username404 Date: Sat, 15 May 2021 01:37:47 +0200 Subject: [PATCH] Add BLACK and GOLD colors to Colors.kt --- .../src/main/kotlin/fr/username404/snowygui/gui/FontUtil.kt | 5 +++-- .../main/kotlin/fr/username404/snowygui/gui/feature/Clock.kt | 4 ++-- .../kotlin/fr/username404/snowygui/gui/feature/Colors.kt | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/FontUtil.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/FontUtil.kt index fd6b425..d9b4de8 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/FontUtil.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/FontUtil.kt @@ -2,12 +2,13 @@ package fr.username404.snowygui.gui import com.mojang.blaze3d.vertex.PoseStack import net.minecraft.client.Minecraft +import fr.username404.snowygui.gui.feature.Colors object FontUtil { - fun drawScaled(stack: PoseStack, text: String, x: Double, y: Double, scaleFactor: Float, color: Int = 0x000000) { + fun drawScaled(stack: PoseStack, text: String, x: Double, y: Double, scaleFactor: Float, color: Colors = Colors.BLACK) { stack.scale(scaleFactor, scaleFactor, scaleFactor) Minecraft.getInstance().font.draw(stack, text, (x / scaleFactor).toFloat(), (y / scaleFactor).toFloat(), color) val factorToOriginal = 1F / scaleFactor stack.scale(factorToOriginal, factorToOriginal, factorToOriginal) } -} \ No newline at end of file +} diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Clock.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Clock.kt index f9954ea..f8f335f 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Clock.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Clock.kt @@ -17,10 +17,10 @@ object Clock: ButtonImpl() { FontUtil.drawScaled(it.first() as PoseStack, "$hour:$minute:${second.let { if (it >= 10) it else "0$it" }}", 5.0, 5.0, - 0.85F, color = 0xe69500 + 0.85F, color = Colors.GOLD ) } } } } -} \ No newline at end of file +} diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Colors.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Colors.kt index 35b78b4..7f08e56 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Colors.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Colors.kt @@ -2,6 +2,8 @@ package fr.username404.snowygui.gui.feature enum class Colors(val hexValue: Int) { TRANSPARENT(-0x1), + BLACK(0x000000), + GOLD(0xe69500), BLUE(0x6C9E9D), RED(0x660000); -} \ No newline at end of file +}