colours as they please, as described <aclass="reference internal"href="../Howto/Manually-Configuring-Color.html"><spanclass="doc std std-doc">here</span></a>.</p>
<p>To see which colours your client support, use the default <codeclass="docutils literal notranslate"><spanclass="pre">@color</span></code> command. This will list all
available colours for ANSI and Xterm256 along with the codes you use for them. You can find a list
of all the parsed <codeclass="docutils literal notranslate"><spanclass="pre">ANSI</span></code>-colour codes in <codeclass="docutils literal notranslate"><spanclass="pre">evennia/utils/ansi.py</span></code>.</p>
<h2>ANSI colours<aclass="headerlink"href="#ansi-colours"title="Permalink to this headline">¶</a></h2>
<p>Evennia supports the <codeclass="docutils literal notranslate"><spanclass="pre">ANSI</span></code> standard for text. This is by far the most supported MUD-color standard,
available in all but the most ancient mud clients. The ANSI colours are <strong>r</strong>ed, <strong>g</strong>reen,
<strong>y</strong>ellow, <strong>b</strong>lue, <strong>m</strong>agenta, <strong>c</strong>yan, <strong>w</strong>hite and black. They are abbreviated by their
first letter except for black which is abbreviated with the letter <strong>x</strong>. In ANSI there are “bright”
and “normal” (darker) versions of each color, adding up to a total of 16 colours to use for
foreground text. There are also 8 “background” colours. These have no bright alternative in ANSI
(but Evennia uses the <aclass="reference internal"href="#xterm256-colours"><spanclass="std std-doc">Xterm256</span></a> extension behind the scenes to offer
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">|n</span></code> - this tag will turn off all color formatting, including background colors.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">|#</span></code>- markup marks the start of foreground color. The case defines if the text is “bright” or
“normal”. So <codeclass="docutils literal notranslate"><spanclass="pre">|g</span></code> is a bright green and <codeclass="docutils literal notranslate"><spanclass="pre">|G</span></code> is “normal” (darker) green.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">|[#</span></code> is used to add a background colour to the text. The case again specifies if it is “bright”
or “normal”, so <codeclass="docutils literal notranslate"><spanclass="pre">|[c</span></code> starts a bright cyan background and <codeclass="docutils literal notranslate"><spanclass="pre">|[C</span></code> a darker cyan background.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">|!#</span></code> is used to add foreground color without any enforced brightness/normal information.
These are normal-intensity and are thus always given as uppercase, such as
<codeclass="docutils literal notranslate"><spanclass="pre">|!R</span></code> for red. The difference between e.g. <codeclass="docutils literal notranslate"><spanclass="pre">|!R</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">|R</span></code> is that
<codeclass="docutils literal notranslate"><spanclass="pre">|!R</span></code> will “inherit” the brightness setting from previously set color tags, whereas <codeclass="docutils literal notranslate"><spanclass="pre">|R</span></code> will
always reset to the normal-intensity red. The <codeclass="docutils literal notranslate"><spanclass="pre">|#</span></code> format contains an implicit <codeclass="docutils literal notranslate"><spanclass="pre">|h</span></code>/<codeclass="docutils literal notranslate"><spanclass="pre">|H</span></code> tag in it:
disabling highlighting when switching to a normal color, and enabling it for bright ones. So <codeclass="docutils literal notranslate"><spanclass="pre">|btest</span><spanclass="pre">|!Rtest2</span></code> will result in a bright red <codeclass="docutils literal notranslate"><spanclass="pre">test2</span></code> since the brightness setting from <codeclass="docutils literal notranslate"><spanclass="pre">|b</span></code> “bleeds over”.
You could use this to for example quickly switch the intensity of a multitude of color tags. There
is no background-color equivalent to <codeclass="docutils literal notranslate"><spanclass="pre">|!</span></code> style tags.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">|h</span></code> is used to make any following foreground ANSI colors bright (it has no effect on Xterm
colors). This is only relevant to use with <codeclass="docutils literal notranslate"><spanclass="pre">|!</span></code> type tags and will be valid until the next <codeclass="docutils literal notranslate"><spanclass="pre">|n</span></code>,
<codeclass="docutils literal notranslate"><spanclass="pre">|H</span></code> or normal (upper-case) <codeclass="docutils literal notranslate"><spanclass="pre">|#</span></code> tag. This tag will never affect background colors, those have to be
set bright/normal explicitly. Technically, <codeclass="docutils literal notranslate"><spanclass="pre">|h|!G</span></code> is identical to <codeclass="docutils literal notranslate"><spanclass="pre">|g</span></code>.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">|H</span></code> negates the effects <codeclass="docutils literal notranslate"><spanclass="pre">|h</span></code> and returns all ANSI foreground colors (<codeclass="docutils literal notranslate"><spanclass="pre">|!</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">|</span></code> types) to
‘normal’ intensity. It has no effect on background and Xterm colors.</p></li>
</ul>
<blockquote>
<div><p>Note: The ANSI standard does not actually support bright backgrounds like <codeclass="docutils literal notranslate"><spanclass="pre">|[r</span></code> - the standard
only supports “normal” intensity backgrounds. To get around this Evennia instead implements these
as <aclass="reference internal"href="#xterm256-colours"><spanclass="std std-doc">Xterm256 colours</span></a> behind the scenes. If the client does not support
Xterm256 the ANSI colors will be used instead and there will be no visible difference between using
upper- and lower-case background tags.</p>
</div></blockquote>
<p>If you want to display an ANSI marker as output text (without having any effect), you need to escape
it by preceding its <codeclass="docutils literal notranslate"><spanclass="pre">|</span></code> with another <codeclass="docutils literal notranslate"><spanclass="pre">|</span></code>:</p>
<p>This will output the raw <codeclass="docutils literal notranslate"><spanclass="pre">|r</span></code> without any color change. This can also be necessary if you are doing
ansi art that uses <codeclass="docutils literal notranslate"><spanclass="pre">|</span></code> with a letter directly following it.</p>
<p>to get a list of all supported ANSI colours and the tags used to produce them.</p>
<p>A few additional ANSI codes are supported:</p>
<ulclass="simple">
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">|/</span></code> A line break. You cannot put the normal Python <codeclass="docutils literal notranslate"><spanclass="pre">\n</span></code> line breaks in text entered inside the
game (Evennia will filter this for security reasons). This is what you use instead: use the <codeclass="docutils literal notranslate"><spanclass="pre">|/</span></code>
marker to format text with line breaks from the game command line.</p></li>
<li><p>`` This will translate into a <codeclass="docutils literal notranslate"><spanclass="pre">TAB</span></code> character. This will not always show (or show differently) to
the client since it depends on their local settings. It’s often better to use multiple spaces.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">|_</span></code> This is a space. You can usually use the normal space character, but if the space is <em>at the
end of the line</em>, Evennia will likely crop it. This tag will not be cropped but always result in a
space.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">|*</span></code> This will invert the current text/background colours. Can be useful to mark things (but see
<h3>Caveats of <codeclass="docutils literal notranslate"><spanclass="pre">|*</span></code><aclass="headerlink"href="#caveats-of"title="Permalink to this headline">¶</a></h3>
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">|*</span></code> tag (inverse video) is an old ANSI standard and should usually not be used for more than to
mark short snippets of text. If combined with other tags it comes with a series of potentially
confusing behaviors:</p>
<ul>
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">|*</span></code> tag will only work once in a row:, ie: after using it once it won’t have an effect again
until you declare another tag. This is an example:</p>
<p>that is, it will not reverse to normal at the second <codeclass="docutils literal notranslate"><spanclass="pre">|*</span></code>. You need to reset it manually:</p>
<p>So <codeclass="docutils literal notranslate"><spanclass="pre">|*</span></code> only considers the ‘true’ foreground color, ignoring any highlighting. Think of the bright
state (<codeclass="docutils literal notranslate"><spanclass="pre">|h</span></code>) as something like like <codeclass="docutils literal notranslate"><spanclass="pre"><strong></span></code> in HTML: it modifies the <em>appearance</em> of a normal
foreground color to match its bright counterpart, without changing its normal color.</p>
<ul>
<li><p>Finally, after a <codeclass="docutils literal notranslate"><spanclass="pre">|*</span></code>, if the previous background was set to a dark color (via <codeclass="docutils literal notranslate"><spanclass="pre">|[</span></code>), <codeclass="docutils literal notranslate"><spanclass="pre">|!#</span></code>) will
actually change the background color instead of the foreground:</p>
<divclass="highlight-default notranslate"><divclass="highlight"><pre><span></span>|*reversed text |!R now BG is red.
</pre></div>
</div>
</li>
</ul>
<p>For a detailed explanation of these caveats, see the [Understanding Color Tags](Understanding-Color-
Tags) tutorial. But most of the time you might be better off to simply avoid <codeclass="docutils literal notranslate"><spanclass="pre">|*</span></code> and mark your text
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">|###</span></code> - markup consists of three digits, each an integer from 0 to 5. The three digits describe
the amount of <strong>r</strong>ed, <strong>g</strong>reen and <strong>b</strong>lue (RGB) components used in the colour. So <codeclass="docutils literal notranslate"><spanclass="pre">|500</span></code> means
maximum red and none of the other colours - the result is a bright red. <codeclass="docutils literal notranslate"><spanclass="pre">|520</span></code> is red with a touch
of green - the result is orange. As opposed to ANSI colors, Xterm256 syntax does not worry about
bright/normal intensity, a brighter (lighter) color is just achieved by upping all RGB values with
the same amount.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">|[###</span></code> - this works the same way but produces a coloured background.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">|=#</span></code> - markup produces the xterm256 gray scale tones, where <codeclass="docutils literal notranslate"><spanclass="pre">#</span></code> is a letter from <codeclass="docutils literal notranslate"><spanclass="pre">a</span></code> (black) to
<codeclass="docutils literal notranslate"><spanclass="pre">z</span></code> (white). This offers many more nuances of gray than the normal <codeclass="docutils literal notranslate"><spanclass="pre">|###</span></code> markup (which only has
four gray tones between solid black and white (<codeclass="docutils literal notranslate"><spanclass="pre">|000</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">|111</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">|222</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">|333</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">|444</span></code>)).</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">|[=#</span></code> - this works in the same way but produces background gray scale tones.</p></li>
</ul>
<p>If you have a client that supports Xterm256, you can use</p>
<p>to get a table of all the 256 colours and the codes that produce them. If the table looks broken up
into a few blocks of colors, it means Xterm256 is not supported and ANSI are used as a replacement.
You can use the <codeclass="docutils literal notranslate"><spanclass="pre">@options</span></code> command to see if xterm256 is active for you. This depends on if your
client told Evennia what it supports - if not, and you know what your client supports, you may have
<p>There is an <aclass="reference internal"href="../Howto/Understanding-Color-Tags.html"><spanclass="doc std std-doc">Understanding Color Tags</span></a> tutorial which expands on the