# Text Formatting

Crown uses a sophisticated text formatting engine. It supports three distinct formats, allowing for simple colors, hex colors, and advanced gradients/components via MiniMessage.

You can mix and match these formats in `messages.yml`, menus, and config files.

## <mark style="color:orange;">MiniMessage (Recommended)</mark>

Crown utilizes the **Adventure MiniMessage** format, which allows for advanced styling like gradients, rainbows, and hover events without complex codes.

<table><thead><tr><th width="96">Format</th><th width="353">Syntax</th><th width="437">Example</th></tr></thead><tbody><tr><td><strong>Color</strong></td><td><code>&#x3C;color_name></code></td><td><code>&#x3C;red>Error!</code>, <code>&#x3C;#ff0000>Red!</code></td></tr><tr><td><strong>Gradient</strong></td><td><code>&#x3C;gradient:color1:color2>Text&#x3C;/gradient></code></td><td><code>&#x3C;gradient:#ff0000:#0000ff>Fire and Ice&#x3C;/gradient></code></td></tr><tr><td><strong>Rainbow</strong></td><td><code>&#x3C;rainbow>Text&#x3C;/rainbow></code></td><td><code>&#x3C;rainbow>Colorful Text&#x3C;/rainbow></code></td></tr><tr><td><strong>Bold</strong></td><td><code>&#x3C;bold>Text&#x3C;/bold></code> or <code>&#x3C;b></code></td><td><code>&#x3C;b>Important&#x3C;/b></code></td></tr><tr><td><strong>Italic</strong></td><td><code>&#x3C;italic>Text&#x3C;/italic></code> or <code>&#x3C;i></code></td><td><code>&#x3C;i>Slanted&#x3C;/i></code></td></tr><tr><td><strong>Reset</strong></td><td><code>&#x3C;reset></code></td><td><code>&#x3C;red>Red &#x3C;reset>Normal</code></td></tr></tbody></table>

{% hint style="info" %}
**Tip:** You can use a visual editor like [WebUI](https://webui.advntr.dev/) to generate these strings easily.
{% endhint %}

### <mark style="color:yellow;">Hex Colors (Legacy & Modern)</mark>

Crown supports direct Hex color codes for precise color matching.

* **Standard Hex:** `&#RRGGBB` (e.g., `&#FF5555`)
* **Hash Hex:** `#RRGGBB` (e.g., `#FF5555`)
* **Spigot format:** `&x&r&r&g&g&b&b` (Internal use, but supported)

### <mark style="color:$success;">Legacy Codes</mark>

Standard Minecraft formatting codes using `&` are fully supported and automatically translated.

| Code | Color/Style | Code | Color/Style  |
| ---- | ----------- | ---- | ------------ |
| `&0` | Black       | `&9` | Blue         |
| `&1` | Dark Blue   | `&a` | Green        |
| `&2` | Dark Green  | `&b` | Aqua         |
| `&3` | Dark Aqua   | `&c` | Red          |
| `&4` | Dark Red    | `&d` | Light Purple |
| `&5` | Dark Purple | `&e` | Yellow       |
| `&6` | Gold        | `&f` | White        |
| `&7` | Gray        | `&l` | **Bold**     |
| `&8` | Dark Gray   | `&o` | *Italic*     |
| `&k` | Obfuscated  | `&r` | Reset        |

#### Example Usage in Config

```yaml
# Using Gradient (MiniMessage)
prefix: "<gradient:#ff801a:#ff4b2b><bold>ᴄʀᴏᴡɴ</bold></gradient> <color:#ff4b2b>🜲</color> "

# Using Legacy Codes
player_not_online: "{prefix}&cPlayer &e{input} &cis not currently online."

# Using Hex Codes
ban_usage: "{prefix}&#FF5555Usage: /ban <player> [time] [reason]"
```
