Difference between revisions of "Template:Color Icons"

From mtgpq wiki
Jump to: navigation, search
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 template parameter is a sequence of upper-case letters from the set WUBRGCL.
+
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|&thinsp;{{ {{#invoke:String|sub|{{{1}}}|2|2}} }} }}<!--
+
-->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 1|&thinsp;{{Symbol|{{#invoke:String|sub|{{{1}}}|2|2}}|{{{2|15}}}}}}}<!--
-->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 2|&thinsp;{{ {{#invoke:String|sub|{{{1}}}|3|3}} }} }}<!--
+
-->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 2|&thinsp;{{Symbol|{{#invoke:String|sub|{{{1}}}|3|3}}|{{{2|15}}}}}}}<!--
-->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 3|&thinsp;{{ {{#invoke:String|sub|{{{1}}}|4|4}} }} }}<!--
+
-->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 3|&thinsp;{{Symbol|{{#invoke:String|sub|{{{1}}}|4|4}}|{{{2|15}}}}}}}<!--
-->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 4|&thinsp;{{ {{#invoke:String|sub|{{{1}}}|5|5}} }} }}<!--
+
-->{{#ifexpr:{{#invoke:String|len|{{{1}}}}} > 4|&thinsp;{{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:

BlueBlackRed