Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Color/doc: Difference between revisions

Template page
m update format and examples
mNo edit summary
 
Line 1: Line 1:
<includeonly>Template doc page transcluded from {{SUBJECTPAGENAME}}/doc</includeonly><noinclude>Documentation for [[Template:Color]]</br></br></noinclude>
<includeonly>Template doc page transcluded from [[{{SUBJECTPAGENAME}}/doc]]</includeonly><noinclude>Documentation for [[Template:Color]]</br></br></noinclude>
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->


Line 10: Line 10:


== Parameters ==
== Parameters ==
{| class="wikitable"
<templatedata>
{{!}}-
{
! Parameter || Description || Type|| Status
"params": {
{{!}}-
"1": {
{{!}} 1 {{!!}} Desired '''text''' 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 || optional
"label": "Text color",
{{!}}-
"description": "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.",
{{!}} 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
"type": "content",
{{!}}-
"suggested": true
{{!}} 3 || Width of the padding of the background color. Useful for large highlights to avoid it looking too small. Default size of 2px. || content || required
},
{{!}}-
"2": {
{{!}} 4 || Text that is being colored. || content || required
"label": "Background Color",
|}
"description": "Desired background color. Can either be a color name, or hex code. Leaving blank will leave the color as the default background color.",
"type": "content"
},
"3": {
"label": "Background color width",
"description": "Width of the padding of the background color. Useful for large highlights to avoid it looking too small. Default size of 2px.",
"type": "content"
},
"4": {
"label": "Text",
"description": "Text that is being colored.",
"type": "content",
"required": true
}
},
"format": "inline"
}
</templatedata>


== Examples ==
== Examples ==

Latest revision as of 18:57, 23 October 2024

Documentation for Template:Color

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.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Text color1

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.

Contentsuggested
Background Color2

Desired background color. Can either be a color name, or hex code. Leaving blank will leave the color as the default background color.

Contentoptional
Background color width3

Width of the padding of the background color. Useful for large highlights to avoid it looking too small. Default size of 2px.

Contentoptional
Text4

Text that is being colored.

Contentrequired

Examples

Inputting the following:

{{color|blue|||This text is blue!}}

Will result in the following:

This text is blue!

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:

This is a random color!

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 important 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:

RAINBOW