Шаблон:Легенда/Документація

Матеріал з Вікімедіа Україна
Перейти до навігації Перейти до пошуку


Can be used to create a map legend entry.

Usage

{{Legend|1=|2=|char=|file=|smallchar=|line=|css=|size=|border=|striped=}}

Getting the color codes

Here follows an example of how to get the color codes by using the freeware IrfanView. First, save the legend image(s) from the source. Open an image with Irfanview. Go to image menu/palette/ and click on "edit palette." Then from the dialog box of color squares that comes up click on the color of interest. The needed color code (value) will show up at the bottom of the dialog box after "HTML". It is the hexadecimal color code consisting of 6 characters or numbers. Copy it into the legend template.

Examples

{{Legend|#ff0000|red box}}
   red box
{{Legend||1px blue line|line=1px solid blue}}
   1px blue line
{{Legend||2px blue dotted line|line=2px dotted blue}}
   2px blue dotted line
{{Legend||3px blue double line|line=3px double blue}}
   3px blue double line
{{Legend||symbol as file|file=City locator 1.svg}}
symbol as file  symbol as file
{{Legend|#C0C0C0|grey character β|char=β}}
β  grey character β
{{Legend|blue|line of little blue crosses|smallchar=xxxxx}}
xxxxx  line of little blue crosses
{{Legend|blue|a triple line composed of unicode symbol for identity|char=≡≡≡≡≡|css=letter-spacing:-2px;}}
≡≡≡≡≡  a triple line composed of unicode symbol for identity
{{Legend|#90DD90|Green with 3px solid brown border|css=border:3px solid #803030}}
   Green with 3px solid brown border
{{Legend|#C0EEC0|2px green dotted border|css=border:2px dotted #408040}}
   2px green dotted border
{{Legend|white|2px green dashed border|css=border:2px dashed #408040}}
   2px green dashed border
{{Legend|red|striped in red, width 1|striped=1}}
striped in red, width 1  striped in red, width 1
{{Legend|blue|striped in blue, width 2|striped=2}}
striped in blue, width 2  striped in blue, width 2
{{Legend|yellow|striped in yellow, width 3|striped=3}}
striped in yellow, width 3  striped in yellow, width 3

Parameters

Parameter name Description Default value required or optional?

parameter #1 (1) color ([1]) white required
parameter #2 (2) caption empty required
char character or string empty optional
file file empty optional
smallchar character or string, just as char but smaller and bold empty optional
line CSS border statement ([2]) rendered as a single line empty optional
css CSS statement to apply to the box empty optional
size size of the file in px (e.g. "20x20"; no "px" at the end) 15x15 optional
border border depends
(either "1px solid gray" or "none")
deprecated
striped width of the stripes, either 1, 2, or 3 empty optional

Additional information

The template is intended to be used in the following namespaces: all namespaces

The template is intended to be used by the following user groups: all users

Localization

This template is not intended to be localized.