Create colored text for Discord with ANSI code blocks. Pick the colors and a style, check the preview on the dark and light theme, then copy and paste.
Discord colors text inside a code block that starts with ```ansi. Inside it, ANSI escape codes set the text color, the background color, bold and underline. The colors show in Discord on desktop and in the browser; the mobile apps may show the block without them.
These are the 8 text colors, codes 30-37, with the names this tool gives them:
The 8 background colors, codes 40-47: Dark Blue (40), Orange (41), Marble Blue (42), Greyish Turquoise (43), Gray (44), Indigo (45), Light Gray (46) and White (47).
Every style change is one escape sequence: the invisible escape character, then [, then one or more code numbers separated by semicolons, then m. This article writes the escape character as ESC; in JavaScript and JSON it is \u001b, in many other languages \x1b. These are the codes this tool writes:
The tool writes one sequence in front of your text and always starts it with 0, so no earlier style carries over: ESC[0;1;31m means reset, bold, red text. A style stays on until a later sequence changes it or resets it with 0, so when you edit a block by hand and want only part of it colored, end that part with ESC[0m.
ansi right after the opening backticks, Discord shows the codes as plain text instead of colors. The block this tool copies starts with ```ansi on a line of its own.ansi tag; text in single backticks, such as `text`, stays one color.\u001b or ESC as text does not create it. Word processors and some editors may also drop it when the text is pasted. Copy the block from this tool straight into Discord.38;2;r;g;b, which some terminals understand, do not give you a color of your own in Discord.For a quick highlight in regular chat, Discord Markdown (bold, headers, lists) is usually the better choice. Use ANSI when you need color, for example for log-style status lines or a colored word inside a code block; the text is then in a monospace font. For important formatted messages from a bot or webhook, such as announcements or structured data, use embeds: they have a colored bar on the left edge and a title, a description and fields.
Powered by Pigona - Free Translation for Discord