From 5b53cc7bda66be5f740749f9fd0cba23927c4d82 Mon Sep 17 00:00:00 2001 From: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Date: Mon, 11 Mar 2024 16:28:59 +0100 Subject: Backend: RenderEntityLiving performance fix (#1127) --- src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt index 36263195d..d1962d140 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt @@ -3,7 +3,6 @@ package at.hannibal2.skyhanni.utils import java.awt.Color import kotlin.math.max - object ColorUtils { /** transfer string colors from the config to java.awt.Color */ @@ -30,4 +29,8 @@ object ColorUtils { alpha ) } + + fun Color.withAlpha(alpha: Int): Int = (alpha.coerceIn(0, 255) shl 24) or (this.rgb and 0x00ffffff) } + + -- cgit