Difference between revisions of "Template:Color Icons"
Line 3: | Line 3: | ||
Given a string of 1 to 5 letters representing colors, produces a corresponding series of space-separated color icons. | Given a string of 1 to 5 letters representing colors, produces a corresponding series of space-separated color icons. | ||
− | The | + | The first parameter is a sequence of upper-case letters from the set WUBRGCL. |
+ | |||
+ | The second parameter (optional) is the size of the icons (default = 15). | ||
==Example== | ==Example== | ||
The following mark-up: | The following mark-up: | ||
<pre><nowiki> | <pre><nowiki> | ||
− | {{Color Icons|UBR}} | + | {{Color Icons|UBR|24}} |
</nowiki></pre> | </nowiki></pre> | ||
Produces: | Produces: | ||
− | {{Color Icons|UBR}} | + | {{Color Icons|UBR|24}} |
[[Category:Symbol templates]] | [[Category:Symbol templates]] | ||
</noinclude><includeonly><!-- | </noinclude><includeonly><!-- | ||
− | -->{{nowrap|{{ {{#invoke:String|sub|{{{1}}}|1|1}} }}<!-- | + | -->{{nowrap|{{Symbol|{{#invoke:String|sub|{{{1}}}|1|1}}|{{{2|15}}}}}<!-- |
− | -->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 1| {{ {{#invoke:String|sub|{{{1}}}|2|2}} }} }}<!-- | + | -->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 1| {{Symbol|{{#invoke:String|sub|{{{1}}}|2|2}}|{{{2|15}}}}}}}<!-- |
− | -->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 2| {{ {{#invoke:String|sub|{{{1}}}|3|3}} }} }}<!-- | + | -->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 2| {{Symbol|{{#invoke:String|sub|{{{1}}}|3|3}}|{{{2|15}}}}}}}<!-- |
− | -->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 3| {{ {{#invoke:String|sub|{{{1}}}|4|4}} }} }}<!-- | + | -->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 3| {{Symbol|{{#invoke:String|sub|{{{1}}}|4|4}}|{{{2|15}}}}}}}<!-- |
− | -->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 4| {{ {{#invoke:String|sub|{{{1}}}|5|5}} }} }}<!-- | + | -->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 4| {{Symbol|{{#invoke:String|sub|{{{1}}}|5|5}}|{{{2|15}}}}}}}<!-- |
-->}}</includeonly> | -->}}</includeonly> |
Revision as of 11:05, 11 March 2019
Usage
Given a string of 1 to 5 letters representing colors, produces a corresponding series of space-separated color icons.
The first parameter is a sequence of upper-case letters from the set WUBRGCL.
The second parameter (optional) is the size of the icons (default = 15).
Example
The following mark-up:
{{Color Icons|UBR|24}}
Produces: