diff options
author | Walker Selby <git@walkerselby.com> | 2023-12-09 15:43:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-10 00:43:57 +0100 |
commit | 34a1b133bfd54f4acb52882f77603594bb72749b (patch) | |
tree | 1084e1f81479e562529b7a67bc7b17df2e49c167 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | bcf4a583c5d238d7b3b1a1d2498d9857c3235172 (diff) | |
download | skyhanni-34a1b133bfd54f4acb52882f77603594bb72749b.tar.gz skyhanni-34a1b133bfd54f4acb52882f77603594bb72749b.tar.bz2 skyhanni-34a1b133bfd54f4acb52882f77603594bb72749b.zip |
Feature: Color Choice for Mark Name (#664)
Option to change the color of Marked Players in chat. #664
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/LorenzColor.kt | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzColor.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzColor.kt index fe3c3bc94..e8b0d76bc 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzColor.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzColor.kt @@ -4,23 +4,24 @@ import at.hannibal2.skyhanni.test.command.ErrorManager import net.minecraft.item.EnumDyeColor import java.awt.Color -enum class LorenzColor(private var chatColorCode: Char, private val color: Color) { - BLACK('0', Color(0, 0, 0)), - DARK_BLUE('1', Color(0, 0, 170)), - DARK_GREEN('2', Color(0, 170, 0)), - DARK_AQUA('3', Color(0, 170, 170)), - DARK_RED('4', Color(170, 0, 0)), - DARK_PURPLE('5', Color(170, 0, 170)), - GOLD('6', Color(255, 170, 0)), - GRAY('7', Color(170, 170, 170)), - DARK_GRAY('8', Color(85, 85, 85)), - BLUE('9', Color(85, 85, 255)), - GREEN('a', Color(85, 255, 85)), - AQUA('b', Color(85, 255, 255)), - RED('c', Color(255, 85, 85)), - LIGHT_PURPLE('d', Color(255, 85, 255)), - YELLOW('e', Color(255, 255, 85)), - WHITE('f', Color(255, 255, 255)), +enum class LorenzColor(private val chatColorCode: Char, private val color: Color, private val coloredLabel: String) { + BLACK('0', Color(0, 0, 0), "§0Black"), + DARK_BLUE('1', Color(0, 0, 170), "§1Dark Blue"), + DARK_GREEN('2', Color(0, 170, 0), "§2Dark Green"), + DARK_AQUA('3', Color(0, 170, 170), "§3Dark Aqua"), + DARK_RED('4', Color(170, 0, 0), "§4Dark Red"), + DARK_PURPLE('5', Color(170, 0, 170), "§5Dark Purple"), + GOLD('6', Color(255, 170, 0), "§6Gold"), + GRAY('7', Color(170, 170, 170), "§7Gray"), + DARK_GRAY('8', Color(85, 85, 85), "§8Dark Gray"), + BLUE('9', Color(85, 85, 255), "§9Blue"), + GREEN('a', Color(85, 255, 85), "§aGreen"), + AQUA('b', Color(85, 255, 255), "§bAqua"), + RED('c', Color(255, 85, 85), "§cRed"), + LIGHT_PURPLE('d', Color(255, 85, 255), "§dLight Purple"), + YELLOW('e', Color(255, 255, 85), "§eYellow"), + WHITE('f', Color(255, 255, 255), "§fWhite"), + CHROMA('Z', Color(0, 0, 0, 0), "§ZChroma") // If chroma, go transparent instead of color code. ; fun getChatColor(): String = "§$chatColorCode" @@ -35,6 +36,8 @@ enum class LorenzColor(private var chatColorCode: Char, private val color: Color return Color(red, green, blue, opacity) } + override fun toString(): String = coloredLabel + companion object { fun EnumDyeColor.toLorenzColor() = when (this) { EnumDyeColor.WHITE -> WHITE @@ -57,4 +60,4 @@ enum class LorenzColor(private var chatColorCode: Char, private val color: Color } } } -}
\ No newline at end of file +} |