Template:Color/doc

The quick Template:Color can be used to add a span of text with any given text color, such as an RGB hex code, #C9E72A, or any of the web colors: red, blue, green, moccasin, or darkorchid, etc. The foreground text color is set, but to reset the background color, see:.

Usage


For example:

gives: Hello, world!

gives: Hello, world!

Wikitext generated:



See: Web colors, for a list of colors. A misspelled color name will not be reported, but will cause the text to remain as black text.

Template data
{       "description": "The color template can be used to add a span of text with any given text color", "params": { "color": { "label": "Color name or code", "description": "Name of color or hex code of color", "type": "string", "required": true },               "text": { "label": "Alpha-numeric text", "description": "The string of text to be be formatted in the desired color", "type": "string", "required": true }       } }

Performance considerations
The template merely uses a span tag:. It runs at speeds in excess of 700 per second, and so it is functionally identical to the longer span-tag markup.