Template:ColorGallery/Color: Difference between revisions
Jump to navigation
Jump to search
m (Moved image to center if image width is specified more than the actual image.) |
(Added "showtext" option to allow hiding text.) |
||
Line 1: | Line 1: | ||
<includeonly><span style="text-align:left; float:left; overflow:hidden; margin:1px; border-style:double"><div>[[File:{{#if:{{{fileName|}}}|{{{fileName}}}|{{#var:filePrefix}}{{{1}}}{{#var:fileSuffix}}.{{#var:imageFileTypes}}}} | center | {{#var:imagewidths}}x{{#var:imageheights}}px | {{{text|Color {{{1}}}}}}]]</div><div style="line-height:1; text-align:center; width:{{#var:imagewidths}}px; height:28px">{{{text|Color {{{1}}}}}}</div></span></includeonly><noinclude>__NOTOC__==Usage== | <includeonly><span style="text-align:left; float:left; overflow:hidden; margin:1px; border-style:double"><div>[[File:{{#if:{{{fileName|}}}|{{{fileName}}}|{{#var:filePrefix}}{{{1}}}{{#var:fileSuffix}}.{{#var:imageFileTypes}}}} | center | {{#var:imagewidths}}x{{#var:imageheights}}px | {{{text|Color {{{1}}}}}}]]</div><div style="line-height:1; text-align:center; width:{{#var:imagewidths}}px; height:28px">{{#ifeq:{{#var:showtext}}|yes|{{{text|Color {{{1}}}}}}|}}</div></span></includeonly><noinclude>__NOTOC__==Usage== | ||
To be used exclusively with [[Template:ColorGallery]]. | To be used exclusively with [[Template:ColorGallery]]. | ||
===Template Parameters=== | ===Template Parameters=== | ||
*'''unlabeled parameter''': The number this color is supposed to be. | *'''unlabeled parameter''': The number this color is supposed to be. | ||
*'''text''': The text listed below the color. (Default:Color [number]) | *'''text''': The text listed below the color. Will show no text if "showtext" is set to "no" in ColorGallery (Default:Color [number]) | ||
==Example== | ==Example== | ||
===Source code:=== | ===Source code:=== | ||
<nowiki>{{ColorGallery | filePrefix=NPB Ignis Color_| imagewidths=220 |imageheights=220 | colors= | <nowiki>{{ColorGallery | filePrefix=NPB Ignis Color_| imagewidths=220 |imageheights=220 | showtext= no | colors= | ||
{{ColorGallery/Color|1}} | {{ColorGallery/Color|1}} | ||
{{ColorGallery/Color|2}} | {{ColorGallery/Color|2}} | ||
Line 30: | Line 30: | ||
}}</nowiki> | }}</nowiki> | ||
===Output:=== | ===Output:=== | ||
{{ColorGallery | filePrefix=NPB Ignis Color_| imagewidths=220 |imageheights=220 | colors= | {{ColorGallery | filePrefix=NPB Ignis Color_| imagewidths=220 |imageheights=220 | showtext= no | colors= | ||
{{ColorGallery/Color|1}} | {{ColorGallery/Color|1}} | ||
{{ColorGallery/Color|2}} | {{ColorGallery/Color|2}} |
Revision as of 05:19, 22 December 2019
Usage
To be used exclusively with Template:ColorGallery.
Template Parameters
- unlabeled parameter: The number this color is supposed to be.
- text: The text listed below the color. Will show no text if "showtext" is set to "no" in ColorGallery (Default:Color [number])
Example
Source code:
{{ColorGallery | filePrefix=NPB Ignis Color_| imagewidths=220 |imageheights=220 | showtext= no | colors= {{ColorGallery/Color|1}} {{ColorGallery/Color|2}} {{ColorGallery/Color|3}} {{ColorGallery/Color|4}} {{ColorGallery/Color|5}} {{ColorGallery/Color|6}} {{ColorGallery/Color|7}} {{ColorGallery/Color|8}} {{ColorGallery/Color|9}} {{ColorGallery/Color|10}} {{ColorGallery/Color|11}} {{ColorGallery/Color|12}} {{ColorGallery/Color|13}} {{ColorGallery/Color|14}} {{ColorGallery/Color|15}} {{ColorGallery/Color|16}} {{ColorGallery/Color|17}} {{ColorGallery/Color|18}} {{ColorGallery/Color|19}} {{ColorGallery/Color|20}} {{ColorGallery/Color|21}} }}