Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
mems01 committed Jan 4, 2025
1 parent 6066d68 commit 37f1565
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,13 @@ object ChineseHat : Module("ChineseHat", Category.RENDER) {
private fun figureOutColor(entity: EntityLivingBase): Color {
val dist = mc.thePlayer.getDistanceSqToEntity(entity).coerceAtMost(255.0).toInt()

val colorMode = colorMode.lowercase()

val alpha = colors.color().alpha

return when {
entity is EntityPlayer && entity.isClientFriend() -> Color(0, 0, 255)
teams && Teams.isInYourTeam(entity) -> Color(0, 162, 232)
colorMode == "custom" -> colors.color()
colorMode == "distancecolor" -> Color(255 - dist, dist, 0)
colorMode == "rainbow" -> ColorUtils.rainbow()
else -> Color(255, 255, 255)
}.withAlpha(alpha)
colorMode == "Custom" -> colors.color()
colorMode == "DistanceColor" -> Color(255 - dist, dist, 0)
colorMode == "Rainbow" -> ColorUtils.rainbow()
else -> Color.WHITE
}.withAlpha(colors.color().alpha)
}
}

0 comments on commit 37f1565

Please sign in to comment.