Skip to content

Commit

Permalink
minecraft/text: Add Resin color (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
inotflying authored Nov 16, 2024
1 parent 39b816f commit 2ce4a98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion minecraft/text/colour.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

// cleaner represents the regex used to clean Minecraft formatting codes from a string.
var cleaner = regexp.MustCompile("§[0-9a-u]")
var cleaner = regexp.MustCompile("§[0-9a-v]")

// Clean removes all Minecraft formatting codes from the string passed.
func Clean(s string) string {
Expand Down
4 changes: 4 additions & 0 deletions minecraft/text/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const (
Diamond = "§s"
Lapis = "§t"
Amethyst = "§u"
Resin = "§v"
)

const (
Expand Down Expand Up @@ -64,6 +65,7 @@ const (
ansiDiamond = "\x1b[38;5;122m"
ansiLapis = "\x1b[38;5;4m"
ansiAmethyst = "\x1b[38;5;171m"
ansiResin = "\x1b[38;5;172m"

ansiObfuscated = ""
ansiBold = "\x1b[1m"
Expand Down Expand Up @@ -99,6 +101,7 @@ var m = map[string]string{
Diamond: ansiDiamond,
Lapis: ansiLapis,
Amethyst: ansiAmethyst,
Resin: ansiResin,

Obfuscated: ansiObfuscated,
Bold: ansiBold,
Expand Down Expand Up @@ -139,6 +142,7 @@ var strMap = map[string]string{
"diamond": Diamond,
"lapis": Lapis,
"amethyst": Amethyst,
"resin": Resin,
}

// minecraftReplacer and ansiReplacer are used to translate ANSI formatting codes to Minecraft formatting
Expand Down

0 comments on commit 2ce4a98

Please sign in to comment.