Add BLACK and GOLD colors to Colors.kt
This commit is contained in:
parent
a8c4bf4709
commit
b6b001cad0
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue