Template:Composition bar: Difference between revisions
Appearance
Pepperonipi (talk | contribs) Added text attribute |
Jaspattack (talk | contribs) mNo edit summary |
||
| Line 2: | Line 2: | ||
| rgb({{#expr:255*{{{3|255}}}}}, {{#expr:255*{{{4|0}}}}}, {{#expr:255*{{{5|0}}}}}) | | rgb({{#expr:255*{{{3|255}}}}}, {{#expr:255*{{{4|0}}}}}, {{#expr:255*{{{5|0}}}}}) | ||
| {{{hex|{{{3|#C0D1E9}}}}}} | | {{{hex|{{{3|#C0D1E9}}}}}} | ||
}}; width: {{#ifeq: {{{2|}}}|inf|100|{{#expr:(({{{1|50}}}/{{{2|100}}})*100) round (-1*{{min|0|{{Order of magnitude|{{#expr:({{{1|50}}}/{{{2|100}}})*100}}}}}}) }}}}%; height: 100%;"></div></div></div><noinclude> | }}; width: {{#ifeq: {{{2|}}}|inf|100|{{#expr:(({{{1|50}}}/{{{2|100}}})*100) round (-1*{{min|0|{{Order of magnitude|{{#expr:({{{1|50}}}/{{{2|100}}})*100}}}}}}) }}}}%; height: 100%;"></div></div></div><noinclude>{{Documentation}}</noinclude> | ||
{{Documentation}}</noinclude> | |||
Latest revision as of 00:43, 9 September 2020
50 / 100
| Parts of this documentation were copied from the English Wikipedia article on this module. Note that the documentation could have been edited since copying. |
The Composition bar template displays the numeric composition of a thing in terms of its sub-units. It can also be used as a meta template.
Parameters
1- the number of subunits2- the total number of subunits possible3- (default is #C0D1E9) The third parameter is the background color of the left part of the bar - a valid web color, which can be specified by name, as a hex triplet (#rrbbgg), or rgb triplet (rgb(0–255,0–255,0–255)).background-color- (default is transparent) is the background color of the right part of the bar - a valid web color.border- (default is #aaa) is the color of the border, or "none" for no borderwidth- (default is 100px) a width value for the bar, such as "100%" or "8em" (unitless numbers are interpreted as px)per- (default is false), when set to any value (true), adds a percentage to the bar as wellref- (default is blank), may be used to add a reference/citation for the numbers.
Examples
| Code | Result |
|---|---|
{{Composition bar|4|16}}
|
4 / 16
|
{{Composition bar|90|100|#F0F0F0|per=1|background-color=#F00}}
|
90 / 100 (90%)
|