Template:ColorGallery/Color: Difference between revisions

From Mizuumi Wiki
Jump to navigation Jump to search
(Allowed option to use a specific file name per color. Also fixed width not using the right variable.)
No edit summary
 
(21 intermediate revisions by 2 users not shown)
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}}}} | {{#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><!--
To be used exclusively with [[Template:ColorGallery]].
  // Create a span that floats left
===Template Parameters===
--><span style="float:left; border:1px #aaa solid; margin-right:-1px;"><!--
*'''unlabeled parameter''': The number this color is supposed to be.
  -->{{#ifeq:{{#var:showtext}}|yes|<!--
*'''text''': The text listed below the color. (Default:Color [number])
      --><div class="color-gallery-header" style="width:{{#var:imagewidths}}px; height:{{#var:textHeights}}; display:flex; justify-content:center; align-items:center; flex-wrap:wrap;">{{#if:{{{text|}}} | {{{text}}} | Color {{{1}}} }}</div>}}<!--
==Example==
  --><div {{#ifeq:{{#var:forceImageHeights}}|yes|style="height:{{#var:imageheights}}px;"}}><!--
===Source code:===
      -->[[File:<!--
<nowiki>{{ColorGallery | filePrefix=NPB Ignis Color_| imagewidths=220 |imageheights=220 | colors=
        -->{{#if: {{{filename|}}} |<!--
{{ColorGallery/Color|1}}
            // If specific filename is present, set that file as display
{{ColorGallery/Color|2}}
            -->{{{filename}}} |<!--
{{ColorGallery/Color|3}}
            // If no file name, use variables given to create filename
{{ColorGallery/Color|4}}
            -->{{#var:filePrefix}}{{{1}}}{{#var:fileSuffix}}.{{{fileTypeOverride|{{#var:imageFileTypes}}}}}<!--
{{ColorGallery/Color|5}}
        -->}}<!--
{{ColorGallery/Color|6}}
    --> | center | {{#var:imagewidths}}x{{#var:imageheights}}px | {{{text|Color {{{1}}}}}} ]]<!--
{{ColorGallery/Color|7}}
  --></div><!--
{{ColorGallery/Color|8}}
--></span></includeonly><noinclude>
{{ColorGallery/Color|9}}
See [[Template:ColorGallery]] for documentation.
{{ColorGallery/Color|10}}
[[Category:Universal]]
{{ColorGallery/Color|11}}
[[Category:Templates]]
{{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}}
}}</nowiki>
===Output:===
{{ColorGallery | filePrefix=NPB Ignis Color_| imagewidths=220 |imageheights=220 | 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}}
}}
</noinclude>
</noinclude>

Latest revision as of 23:10, 8 May 2021

See Template:ColorGallery for documentation.