Template:Color: Difference between revisions
More actions
mNo edit summary |
m Testing background color |
||
| Line 1: | Line 1: | ||
<span style="color: {{#if:{{{1|}}}|{{{1}}}|red}} | <span style="color: {{#if:{{{1|}}}|{{{1}}}|blue}}; background-color: {{#if:{{{2|}}}|{{{2}}}|red}}">{{{3}}}</span><noinclude> | ||
Revision as of 18:12, 19 March 2024
{{{3}}}
Useage
To be used to color text, or the background of text.
{{color|1|2|3|4}}
{{color|text color|background color|background padding|text you are coloring}}
Parameters
No description.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Text color | 1 | Desired color, either a [https://www.w3schools.com/tags/ref_colornames.asp color name] or Hex code. Leaving blank will leave the color as the default text color. | Content | suggested |
| Background Color | 2 | Desired background color. Can either be a color name, or hex code. Leaving blank will leave the color as the default background color. | Content | optional |
| Background color width | 3 | Width of the padding of the background color. Useful for large highlights to avoid it looking too small. Default size of 2px. | Content | optional |
| Text | 4 | Text that is being colored. | Content | required |
Examples
Inputting the following:
{{color|blue|||This text is blue!}}
Will result in the following:
Alternatively, a hex code for a non-html color can be used in order to specify a specific color. For example:
{{color|#1e92bd|||This is a random color!}}
Will result in the following:
Or even to add a highlight to a string of text:
This is {{color||yellow||important}} doccumentation.
Which will result in the following:
- This is doccumentation.
And, it can be used in close conjunction for rapid color changes, and can be placed within one another:
{{color||lightgrey|{{color|red|||R}}{{color|orange|||A}}{{color|yellow|||I}}{{color|green|||N}}{{color|blue|||B}}{{color|indigo|||O}}{{color|violet|||W}}}}
Which will result in the following:
- 2px