Template:Stat Bar
Template:Stat Bar renders a coloured 10-segment bar showing how many of the maximum 30 potions can be consumed for a given stat.
Overview
This template draws a small bar made of ten ■/□ blocks preceded by the numeric label amount/30 in bold. The number of filled blocks reflects the amount value, and the colour of the bar is chosen either from a named stat (via Template:Stat Color) or from a raw colour code. It is used to show maximum potion consumption per stat, and is the building block used by Template:Stat Table, which calls one Stat Bar per stat row.
Parameters
| Parameter | Required? | What it does | Example |
|---|---|---|---|
amount |
Required | How full the bar is, out of 30. Only the exact values 0, 5, 10, 15, 20, 25, 30 are recognised; any other value renders a red "Error: Invalid Argument". Also shown as the amount/30 label. |
amount=20
|
stat |
Optional | A stat name passed to Template:Stat Color to colour the bar (e.g. health, attack, defense/defence, speed, evasion, vitality, crit and its aliases). Takes priority over color if both are given. |
stat=speed
|
color |
Optional | A raw CSS colour for the bar, used only when stat is not given. |
color=#55ffff
|
How to use
1. Type {{Stat Bar.
2. Set |amount= to one of the allowed steps: 0, 5, 10, 15, 20, 25, or 30. Other numbers produce an error message instead of a bar.
3. Choose a colour one of two ways:
|stat=speed— colours the bar by stat name (recommended; keeps colours consistent site-wide). This wins if both are present.|color=#55ffff— a literal colour code, for arbitrary colours.
4. Close with }}.
Special-syntax note: the fill levels are a fixed lookup — each allowed amount maps to a specific ■/□ pattern (e.g. 25 → ■■■■■■■■□□). There is no smooth scaling, so you must use one of the seven listed values.
Copy this
{{Stat Bar|stat=|amount=}}Example
Live result:
15/30 ■■■■■□□□□□
Wikitext that produced it:
{{Stat Bar|stat=defense|amount=15}}Using a raw colour instead of a stat:
20/30 ■■■■■■□□□□
{{Stat Bar|color=#55ffff|amount=20}}Tips & notes
- Valid
amountvalues are only 0, 5, 10, 15, 20, 25, 30 — anything else (including 1, 12, 35) shows a red error, not a bar. - If you set both
statandcolor,statwins. - Prefer
statovercolorso bar colours stay consistent with Template:Stat Color across the wiki. - Related: Template:Stat Color (the colour lookup it uses) and Template:Stat Table (builds a full table of these bars).