This page is protected against editing.


From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Legend/doc.

Can be used to create a map legend entry. The box size is about 32×21px and cannot be altered.


{{Legend |1= |2= }}

Getting the color codes

At these tables you may see 16 × 16 × 16 colors, to be specified with #rgb and to be copied from there.

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. See also {{Xconv}}.

Many other image editors have a similar "color picker" tool (e.g. The GIMP,, etc. or commercial products like Photoshop), but beware:

  • Don't use the "Paint" accessory of old versions of Windows if it cannot read the original graphics file format (you can use it only on Windows versions that can read the PNG thumbnails generated by the image server on Commons, and can load this image with its native 24-bit or 32-bit "true" colors). If you have such old version of Windows, please use some other paint tool.
  • Don't use image converters, or screen capture tools to save a screenshot of the image rendered in your browser, because the browser may have altered the rendered image (e.g. with dithering, or modified color gamut according to your local display settings and preferences) and because the screen capture tool may want to save the image in some "optimized" palette (different from the original) or may also dither the saved image in this generated palette.


{{Legend | #F00 | red box| css="title="the color is '#F00'}}
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 | gold | 22px red dotted line | line=22px dotted red}}
22px red dotted line
{{Legend | #CFF | 4px blue double line | line=4px double blue}}
4px blue double line
{{Legend | | symbol as file | file=City locator 1.svg}}
symbol as file
{{Legend | #C0C0C0 | grey character β | char=β}}
grey character β
{{Legend | blue | line of little blue crosses | smallchar=xxxxx}}
line of little blue crosses
{{Legend | blue | a triple line composed of unicode symbol for identity | char=≡≡≡≡≡ | css=margin-left:-.2em;letter-spacing:-.3em;}}
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 (#803030)
{{Legend | #C0EEC0 | 2px green dotted border | css=border:2px dotted #408040}}
2px green dotted border (#408040)
{{Legend | white | 2px green dashed border | css=border:2px dashed #408040"title="blanc}}
2px green dashed border (#408040)
{{Legend | #EAECF0 | 1px gray border like wikitable | css=border:1px solid #A2A9B1}}
1px gray border (#A2A9B1, like wikitable class)
{{Legend | red | striped in red, width 1 (with {{F|SVGstripes1.svg|1}}) | striped=1}}
striped 1
striped in red, width 1 (with 1)
{{Legend | blue | striped in blue, width 2 (...) | striped=2 | css=opacity:.5"title="semi}}
striped 2
striped in blue, width 2 (with 2)
{{Legend | yellow | striped in yellow, width 3 (...) | striped=3}}
striped 3
striped in yellow, width 3 (with 3)
———————————————————————————————————————————————— ——————————————
00 Legend tables transcluded by {{Legtab}} or {{ColorString}}: possibility for more fields, separated by slashes or pipes
{{ LegtabE)#CFClight green color, striped with {{F|SVGstripesE.svg|E}} }}:
striped E
light green color, striped with E
{{ Legtab#0f47af/azure/#DA121A/gules/#999/cendrée }}:
0"none" makes exactly nothing in the exact size of a box (but can display text, if any)

{{ Legtab#069wmbnone{{0}}#396wmgnone(gap)wmrwmr }}:
0(see the description of Cathedral schematic plan empty vectorial.svg)

{{Legend-line}}s within a legend table:
{{ Legtab//#396/land/#03C solid 3px/river/#030 dashed 2px/border/#06F/sea/12px #D00 dotted/dot }}:
(precede with two slashes to set the lines width)
Bordered Legends:
{{ Legtab//lime #F00 solid .5px/ /E)Orchid Navy solid 2px/ /gules white solid 6px/ }}
striped E

Template parameters

1color (CSS colors list) or "transparent"whiterequired
charcharacter or string to displayemptyoptional
filefile to displayemptyoptional
smallcharcharacter or string, just as char but smaller and boldemptyoptional
lineCSS border statement (CSS border Property) rendered as a single lineemptyoptional
cssCSS statement to apply to the box, e.g. css=opacity:.25 and/or e.g. css="title="any_textemptyoptional
sizesize of the file in px (e.g. "20x20"; no "px" at the end)15x15optional
borderborder: (either "1px solid gray" or "none")dependsdeprecated
stripedwidth of the stripes, either 1, 2, or 3
another possibility to define stripes is to prefix parameter 1 with 1) 2) 3)
langlanguage code, used to determine the layout direction (ltr or rtl). If not specified, the layout will be ltr (left-to-right) by default.emptyoptional
styleoverrides the default style of display:blockemptyoptional

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


This template is not intended to be localized.

See also