From 7265a2009b13119e6c171a4e4eff407306355cd5 Mon Sep 17 00:00:00 2001 From: Lucy <127942625+Adrian8115@users.noreply.github.com> Date: Sun, 26 May 2024 20:35:28 +0200 Subject: [PATCH 1/2] Create use-color-codes.md --- docs/tutorials/use-color-codes.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/tutorials/use-color-codes.md diff --git a/docs/tutorials/use-color-codes.md b/docs/tutorials/use-color-codes.md new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/docs/tutorials/use-color-codes.md @@ -0,0 +1 @@ + From 9257c627f8dd9d850680cc66f00adbba8e918d61 Mon Sep 17 00:00:00 2001 From: Lucy <127942625+Adrian8115@users.noreply.github.com> Date: Sun, 26 May 2024 21:19:32 +0200 Subject: [PATCH 2/2] feat: complete use-color-codes.md --- docs/tutorials/use-color-codes.md | 62 +++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/docs/tutorials/use-color-codes.md b/docs/tutorials/use-color-codes.md index 8b1378917..3e02cb610 100644 --- a/docs/tutorials/use-color-codes.md +++ b/docs/tutorials/use-color-codes.md @@ -1 +1,63 @@ +# Use color codes +Color codes are used to customize the color and formatting of text in the game, such as on signs, in chat, in titles, in forms and more. These color codes are represented by the section sign (§) followed by a character. Each character represents a different color or formatting option. Endstone wants to make it easy to use them, that is why an easy to use api is provided. + +=== ":fontawesome-brands-python: Python" + + This code shows how easy it is to use colored text in endstone: + + ```py + my_beautiful_text = f"This is {ColorFormat.YELLOW} yellow, {ColorFormat.AQUA} aqua and {ColorFormat.GOLD} gold{ColorFormat.RESET}." + ``` + + *Pythons f-strings are awesome.* + + Don't forget to end the colored text with `{ColorFormat.RESET}`, + it ends all extra color format options and resets them. + +=== ":simple-cplusplus: C++" + + This code shows how easy it is to use colored text in endstone: + + ```cpp + std::string my_beautiful_text = "This is " + endstone::ColorFormat::DarkGreen + "dark green." + endstone::ColorFormat::Reset; + ``` + + Don't forget to end the colored text with `endstone::ColorFormat::Reset`, + it ends all extra color format options and resets them. + +A simple list of all colors and their equivalent color codes can be found here: + +| Color/Style | Code | +|---------------------|------| +| AQUA | §b | +| BLACK | §0 | +| BLUE | §9 | +| BOLD | §l | +| DARK_AQUA | §3 | +| DARK_BLUE | §1 | +| DARK_GRAY | §8 | +| DARK_GREEN | §2 | +| DARK_PURPLE | §5 | +| DARK_RED | §4 | +| GOLD | §6 | +| GRAY | §7 | +| GREEN | §a | +| ITALIC | §o | +| LIGHT_PURPLE | §d | +| MATERIAL_AMETHYST | §u | +| MATERIAL_COPPER | §n | +| MATERIAL_DIAMOND | §s | +| MATERIAL_EMERALD | §q | +| MATERIAL_GOLD | §p | +| MATERIAL_IRON | §i | +| MATERIAL_LAPIS | §t | +| MATERIAL_NETHERITE | §j | +| MATERIAL_QUARTZ | §h | +| MATERIAL_REDSTONE | §m | +| MINECOIN_GOLD | §g | +| OBFUSCATED | §k | +| RED | §c | +| RESET | §r | +| WHITE | §f | +| YELLOW | §e |