Template:Color: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
No edit summary
m (Protected "Template:Color" (‎[edit=sysop] (indefinite) ‎[move=sysop] (indefinite)))
 
(18 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{Navbox
<span style="color:{{{1|}}}">{{{2|}}}</span><noinclude>
| name = Color
{{doc}}</noinclude>
| title = [[Color|Major Colors]]|
| group1 = [[List of colors|List]]
| list1 = '''Major [[Primary color|Primary colors]]''':[[Blue]]{{color|blue|*}} [[Green]]{{color|Green|*}} [[Red]]{{color|red|*}}  
<br>'''Major [[Additive color|Additive colors]] or [[Secondary color|Secondary colors]]''': [[Brown]]{{color|brown|*}} [[Orange (colour)|Orange]]{{color|orange|*}} [[Pink]]{{color|pink|*}} [[Purple]]{{color|purple|*}} [[Violet (color)|Violet]]{{color|Violet|*}} [[Yellow]]{{color|yellow|*}}
}}<noinclude>

Latest revision as of 20:22, 27 July 2013

[edit] Template documentation

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.

Usage

{{color|name of color or hex code of color|Text}}

For example:

{{color|red|Hello, world!}} gives:  Hello, world!
{{color|#00F000|Hello, world!}} gives:  Hello, world!

Wikitext generated:

<span style="color:{{{1|}}}">{{{2|}}}</span>

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.

Performance considerations

The template merely uses a span tag:  <span style="color:{{{1}}}">{{{2}}}</span>. It runs at speeds in excess of 700 per second, and so it is functionally identical to the longer span-tag markup.