Template:Colored text
{{{2}}}
1. Go to the template page, go to edit mode.
2. In the code, find the row of text that says # ======= CUSTOM COLORS ADDED HERE ========= -->
.
3. You can add new custom colors under it (see the amber for example).
Use this format:
| c:color-name = value
.
- Replace color-name
with a name for you color.
- Replace value
with a CSS-color value.
4. Press to open a preview of the docs page. If the colors are all gone, you did something wrong.
5. Press c:
part).
6. Press
7. Save changes to the template page.
8. Add your brand new custom color to the custom colors section on the documentation page for others to see and use.
Colors
Red text using one of the predefined CSS colors: red
{{ColoredText|red|hello world, I'm red}}
This text hello world, I'm red has a custom color.
Gold text using hex code for gold: #ffd700
{{ColoredText|#ffd700|GOLD GOLD GOLD}}
This text GOLD GOLD GOLD has a custom color.
Orange text using HSL: hsl(24, 100%, 50%)
{{ColoredText|hsl(24, 100%, 50%)|orange energy}}
This text orange energy has a custom color.
CosmoGreen text using one of the CSS variables: --color-cosmoGreen
{{ColoredText|--color-cosmoGreen|space green}}
This text space green has a custom color.
Custom amber text using one of the custom colors c:amber
{{ColoredText|c:amber|Custom amber}}
This text amber-brr has a custom color.
List of custom colors
Custom color | Result (bold for readability) |
---|---|
c:_const_value |
This color is ment to be used to color any numerical constant. |
c:_enum_name |
This color is ment to be used to color any enum value name. |
c:_important |
This color is ment to be used to color anything "important", that needs to stand out from anything else. |
c:amber |
A big spaceship traverses the hyperspace. |
Modifiers
Disabling inline text
{{ColoredText|inline=0|--color-cosmoGreen|space green}}
space green
is not inline.Other
Multiline text (inline)
<br>
, {{br}}
will not work.This text {{ColoredText|--color-cosmoGreen|space green<br>
moreeee greeen<br>
green}} is multiline inline text.
This text space green
moreeee greeen
green is multiline inline text.
Multiline text (NOT inline)
This text {{ColoredText|space green{{br}}
moreeee greeen<br>
green|--color-cosmoGreen|inline=0}} is multiline text NOT in inline mode.
space green
moreeee greeen
green
An easy way to give your text a color.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Color | 1 | A CSS-compatible or a custom (starts with "c:") color, like red, #123456, rgb(1, 2, 3), c:amber or even an existing CSS variable, e.g. --color-cosmoGreen. See more on what's supported (for CSS colors): https://developer.mozilla.org/en-US/docs/Web/CSS/color
| String | required |
Text | 2 | A text to add a color to. | Content | required |
Inline | inline | Whether to generate inline text. Enabled by default. Set to any value besides 1 to disable.
| Boolean | suggested |