Template:Color/doc: Difference between revisions
Jump to navigation
Jump to search
(added doccumentation for text highlight) |
(Better examples, changed order) |
||
Line 31: | Line 31: | ||
Alternatively, a hex code for a non-html color can be used in order to specify a specific color. For example: | Alternatively, a hex code for a non-html color can be used in order to specify a specific color. For example: | ||
:<nowiki>{{color|# | :<nowiki>{{color|#1e92bd||This is a random color!}}</nowiki> | ||
Will result in the following: | Will result in the following: | ||
:{{color|# | :{{color|#1e92bd||This is a random color!}} | ||
---- | ---- | ||
Or even to add a highlight to a string of text: | |||
:<nowiki>{{color| | :<nowiki>This is {{color||yellow|important}} doccumentation.</nowiki> | ||
Which will result in the following: | Which will result in the following: | ||
:{{color| | :This is {{color||yellow|important}} doccumentation. | ||
---- | ---- | ||
And, it can be used in close conjunction for rapid color changes, and can be placed within one another: | |||
:<nowiki> | :<nowiki>{{color||lightgrey|{{color|red||R}}{{color|orange||A}}{{color|yellow||I}}{{color|green||N}}{{color|blue||B}}{{color|indigo||O}}{{color|violet||W}}}}</nowiki> | ||
Which will result in the following: | Which will result in the following: | ||
: | :{{color||lightgrey|{{color|red||R}}{{color|orange||A}}{{color|yellow||I}}{{color|green||N}}{{color|blue||B}}{{color|indigo||O}}{{color|violet||W}}}} |
Revision as of 18:28, 19 March 2024
Documentation for Template:Color
Useage
To be used to color text, or the background of text.
{{color|1|2|3}}
{{color|text color|background color|text you are coloring}}
Parameters
Parameter | Description | Type | Status |
---|---|---|---|
1 | Desired text color, either a color name or Hex code. Leaving blank will leave the color as the default text color. | content | optional |
2 | Desired background color. Can either be an color name, or hex code. Leaving blank will leave the color as the default background color. | content | optional |
3 | Text that is being colored. | content | required |
Examples
Inputting the following:
- {{color|blue||This text is blue!}}
Will result in the following:
- {{{4}}}
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:
- {{{4}}}
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 {{{4}}} 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:
- <span style="color: inherited; background-color: lightgrey; border: {{{4}}}{{{4}}}{{{4}}}{{{4}}}{{{4}}}{{{4}}}{{{4}}} solid lightgrey; border-radius: 4px;">{{{4}}}