Documentation ¶
Overview ¶
Package text has utility methods used for formatting text to display in Minecraft, and to convert these colour codes into codes suitable for the command line. It also contains constants for each of the Minecraft colours and formatting codes.
Index ¶
Constants ¶
const ( Black = "§0" DarkBlue = "§1" DarkGreen = "§2" DarkAqua = "§3" DarkRed = "§4" DarkPurple = "§5" Orange = "§6" Grey = "§7" DarkGrey = "§8" Blue = "§9" Green = "§a" Aqua = "§b" Red = "§c" Purple = "§d" Yellow = "§e" White = "§f" DarkYellow = "§g" Quartz = "§h" Iron = "§i" Netherite = "§j" Obfuscated = "§k" Bold = "§l" Redstone = "§m" Copper = "§n" Italic = "§o" Gold = "§p" Emerald = "§q" Reset = "§r" Diamond = "§s" Lapis = "§t" Amethyst = "§u" )
Variables ¶
This section is empty.
Functions ¶
func ANSI ¶
ANSI converts all Minecraft text formatting codes in the values passed to ANSI formatting codes, so that it may be displayed properly in the terminal.
func Colourf ¶
Colourf colours the format string using HTML tags after first escaping all parameters passed and substituting them in the format string. The following colours and formatting may be used:
black, dark-blue, dark-green, dark-aqua, dark-red, dark-purple, gold, grey, dark-grey, blue, green, aqua, red, purple, yellow, white, dark-yellow, quartz, iron, netherite, redstone, copper, gold, emerald, diamond, lapis, amethyst, obfuscated, bold (b), and italic (i).
These HTML tags may also be nested, like so: `<red>Hello <bold>World</bold>!</red>`
Types ¶
This section is empty.