diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/LorenzColor.kt | 8 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt | 9 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzColor.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzColor.kt index 961ed57ec..69763f0c7 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzColor.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzColor.kt @@ -24,4 +24,12 @@ enum class LorenzColor(private var chatColorCode: Char, private val color: Color fun getChatColor(): String = "ยง$chatColorCode" fun toColor(): Color = color + + fun addOpacity(opacity: Int): Color { + val color = toColor() + val red = color.red + val green = color.green + val blue = color.blue + return Color(red, green, blue, opacity) + } }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index 763e4288e..765a075a8 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -22,13 +22,20 @@ object RenderUtils { val beaconBeam = ResourceLocation("textures/entity/beacon_beam.png") infix fun Slot.highlight(color: LorenzColor) { + highlight(color.toColor()) + } + + infix fun Slot.highlight(color: Color) { + GlStateManager.pushMatrix() + GlStateManager.translate(0f, 0f, 110 + Minecraft.getMinecraft().renderItem.zLevel) Gui.drawRect( this.xDisplayPosition, this.yDisplayPosition, this.xDisplayPosition + 16, this.yDisplayPosition + 16, - color.toColor().rgb + color.rgb ) + GlStateManager.popMatrix() } fun RenderWorldLastEvent.drawColor(location: LorenzVec, color: LorenzColor, beacon: Boolean = false) { |