Difference between revisions of "Template:Color Icons"
| Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
==Usage== | ==Usage== | ||
| − | + | Given a string of 1 to 5 letters representing colors, produces a corresponding series of space-separated color icons. | |
The template parameter is a sequence of upper-case letters from the set WUBRGCL. | The template parameter is a sequence of upper-case letters from the set WUBRGCL. | ||
| Line 17: | Line 17: | ||
[[Category:Symbol templates]] | [[Category:Symbol templates]] | ||
| − | </noinclude><includeonly>{{ | + | </noinclude><includeonly><!-- |
| − | {{{1}}} | + | -->{{ {{#invoke:String|sub|{{{1}}}|1|1}} }}<!-- |
| − | | | + | -->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 1| {{ {{#invoke:String|sub|{{{1}}}|2|2}} }} }}<!-- |
| − | | | + | -->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 2| {{ {{#invoke:String|sub|{{{1}}}|3|3}} }} }}<!-- |
| − | | | + | -->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 3| {{ {{#invoke:String|sub|{{{1}}}|4|4}} }} }}<!-- |
| − | | | + | -->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 4| {{ {{#invoke:String|sub|{{{1}}}|5|5}} }} }}<!-- |
| − | | | + | --></includeonly> |
| − | | | ||
| − | | | ||
| − | }}</includeonly> | ||