Changes
Jump to navigation
Jump to search
m
+parm
{{{{#ifeq:{{padleft:|1|{{{1}}}}}|+|{{#ifeq:{{{2}}}|T|Nil2|InFi}}|Nil2}}<!--
-->|1={{#ifeq:{{padleft:|2|{{{1}}}}}|+=|{{#ifeq:{{{1}}}|+=w|Wikimedia colors|{{Strr|{{{1}}}|2}}}}<!--
-->|{{#switch:{{{2}}}|T=|S|B=Color box{{#if:{{{4|}}}|es}}|C|M|D=Colour{{#if:{{{5|}}}|s}}|Legend}}}}
|2={{#switch:{{{2}}}
|+|-|B|C|D|L|M|S|T|X|=
|{{#if:{{{1|}}}|{{Igen/cb1|||{{{1|}}}|{{{2|}}}}}}}}}{{#ifeq:{{{2}}}|T
|{{Tbc|{{#if:{{{5|}}}|B|F}}
|{{#switch:{{{1|}}}|+|-|=|e=e|{{#ifeq:{{padleft:|1|{{{1}}}}}| |e}}}}
|text={{#ifeq:{{padleft:|2|{{{1}}}}}|+=|{{#invoke:Color2dec|rem2bp|{{{1}}}}}
|{{#switch:{{{1|}}}|+|-|e|=|{{{1}}}}}}}}}}}<!-- Tbc:start
-->{{#if:{{{3|}}}{{{4|}}}|{{#invoke:Iteration|colorbox}}}}<!--
-->{{#ifeq:{{{2}}}|T|{{Tbc|6}}}}}}<!-- Tbc:end --><noinclude>
[[Category:Image generation subtemplates| ]]
[[Category:Color text formatting templates| ]]
This {{T0|Image generation|Image generation subtemplate}} performs a display of '''color boxes''', by e.g. {{T|Legend}}.
{{Lua|Module:Color2dec|Module:ConvCSS|Module:Iteration}}
;[[Template:Image_generation#Color_boxes|Transclusion (Igen):]]:
{{Tle|t=Igen|p1=cb|textstring}}
*only ''one'' parameter: either a color name (e.g. "lime") or a color triplet (e.g. "#FC23C4" or "#F0F")
*a parameter ''pair'', like above plus a display text separated by a slash "/",
: or the slash only for an empty second parameter (the first parameter will be used)
*''more'' parameters pairs, like that, separated by slashes
In any of these cases this string can be preceded by a ''control code pair'', e.g. "+/ ";<br>
the first code may be missing, or a "+" to generate a field name; the second parameter may be
* missing for {{T|Legend}} with parameter pairs,
* a "-" for {{T|Legend-small}} with parameter pairs ¹)
* a "L" for the {{T|Legend}} with '''single''' parameter values ²)
* a "B" for {{T|ColorBox|Color boxes}} with '''single''' parameter values
* a "S" for {{T|Legend-small|Color boxes}} with '''single''' parameter values
* a "D" for {{T|ColorBox|Color boxes}} with parameter pairs
* a "T" for {{T|Tbc}} with parameter pairs
:¹) <small>the "-" possibility can also be expressed with an "M" or "C" (caption "Color")</small>
:²) <small>the "L" possibility exists just for completion – normally a "Legend" without an explaining second value will not be useful.</small>
;Transclusion (Igen/cbx):
All slashes are replaced by pipes, so this template gets a row of unnamed parameters.<br>
When the second parameter of a pair is missing, the first parameter <!-- or the color triplet --> will be displayed instead.<br>
When the ''first'' parameter of such a pair is empty, the template terminates.<br>
Template {{T0|Igen/cbox}} and LUA module {{M|Color2dec}} is used.
See examples at {{T0|ColorString|+}} {{0}} <small>and its [[Template talk:ColorString|talk page]]</small>.
</noinclude>
-->|1={{#ifeq:{{padleft:|2|{{{1}}}}}|+=|{{#ifeq:{{{1}}}|+=w|Wikimedia colors|{{Strr|{{{1}}}|2}}}}<!--
-->|{{#switch:{{{2}}}|T=|S|B=Color box{{#if:{{{4|}}}|es}}|C|M|D=Colour{{#if:{{{5|}}}|s}}|Legend}}}}
|2={{#switch:{{{2}}}
|+|-|B|C|D|L|M|S|T|X|=
|{{#if:{{{1|}}}|{{Igen/cb1|||{{{1|}}}|{{{2|}}}}}}}}}{{#ifeq:{{{2}}}|T
|{{Tbc|{{#if:{{{5|}}}|B|F}}
|{{#switch:{{{1|}}}|+|-|=|e=e|{{#ifeq:{{padleft:|1|{{{1}}}}}| |e}}}}
|text={{#ifeq:{{padleft:|2|{{{1}}}}}|+=|{{#invoke:Color2dec|rem2bp|{{{1}}}}}
|{{#switch:{{{1|}}}|+|-|e|=|{{{1}}}}}}}}}}}<!-- Tbc:start
-->{{#if:{{{3|}}}{{{4|}}}|{{#invoke:Iteration|colorbox}}}}<!--
-->{{#ifeq:{{{2}}}|T|{{Tbc|6}}}}}}<!-- Tbc:end --><noinclude>
[[Category:Image generation subtemplates| ]]
[[Category:Color text formatting templates| ]]
This {{T0|Image generation|Image generation subtemplate}} performs a display of '''color boxes''', by e.g. {{T|Legend}}.
{{Lua|Module:Color2dec|Module:ConvCSS|Module:Iteration}}
;[[Template:Image_generation#Color_boxes|Transclusion (Igen):]]:
{{Tle|t=Igen|p1=cb|textstring}}
*only ''one'' parameter: either a color name (e.g. "lime") or a color triplet (e.g. "#FC23C4" or "#F0F")
*a parameter ''pair'', like above plus a display text separated by a slash "/",
: or the slash only for an empty second parameter (the first parameter will be used)
*''more'' parameters pairs, like that, separated by slashes
In any of these cases this string can be preceded by a ''control code pair'', e.g. "+/ ";<br>
the first code may be missing, or a "+" to generate a field name; the second parameter may be
* missing for {{T|Legend}} with parameter pairs,
* a "-" for {{T|Legend-small}} with parameter pairs ¹)
* a "L" for the {{T|Legend}} with '''single''' parameter values ²)
* a "B" for {{T|ColorBox|Color boxes}} with '''single''' parameter values
* a "S" for {{T|Legend-small|Color boxes}} with '''single''' parameter values
* a "D" for {{T|ColorBox|Color boxes}} with parameter pairs
* a "T" for {{T|Tbc}} with parameter pairs
:¹) <small>the "-" possibility can also be expressed with an "M" or "C" (caption "Color")</small>
:²) <small>the "L" possibility exists just for completion – normally a "Legend" without an explaining second value will not be useful.</small>
;Transclusion (Igen/cbx):
All slashes are replaced by pipes, so this template gets a row of unnamed parameters.<br>
When the second parameter of a pair is missing, the first parameter <!-- or the color triplet --> will be displayed instead.<br>
When the ''first'' parameter of such a pair is empty, the template terminates.<br>
Template {{T0|Igen/cbox}} and LUA module {{M|Color2dec}} is used.
See examples at {{T0|ColorString|+}} {{0}} <small>and its [[Template talk:ColorString|talk page]]</small>.
</noinclude>