aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/HighlightInquisitors.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/HighlightInquisitors.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/HighlightInquisitors.kt
index a56554af9..dd48e28c5 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/HighlightInquisitors.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/HighlightInquisitors.kt
@@ -2,8 +2,8 @@ package at.hannibal2.skyhanni.features.event.diana
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper
+import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColorInt
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.SpecialColour
import net.minecraft.entity.player.EntityPlayer
import net.minecraftforge.event.entity.EntityJoinWorldEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -20,7 +20,7 @@ class HighlightInquisitors {
val entity = event.entity
if (entity is EntityPlayer && entity.name == "Minos Inquisitor") {
- val color = SpecialColour.specialToChromaRGB(config.color)
+ val color = config.color.toChromaColorInt()
RenderLivingEntityHelper.setEntityColorWithNoHurtTime(entity, color) { config.highlightInquisitors }
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt
index d1962d140..3b1986d40 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt
@@ -6,7 +6,9 @@ import kotlin.math.max
object ColorUtils {
/** transfer string colors from the config to java.awt.Color */
- fun String.toChromaColor() = Color(SpecialColour.specialToChromaRGB(this), true)
+ fun String.toChromaColor() = Color(toChromaColorInt(), true)
+ fun String.toChromaColorInt() = SpecialColour.specialToChromaRGB(this)
+
fun getRed(colour: Int) = colour shr 16 and 0xFF
fun getGreen(colour: Int) = colour shr 8 and 0xFF