Template:Legend/doc

From Wikispecies
Jump to navigation Jump to search

Template:Use sandbox

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

Usage

{{Legend |1= |2= }}

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.

Many other image editors have a similar "color picker" tool (e.g. The GIMP, Paint.net, 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.

Examples


{{Legend|#F00|red box|css=" title="color=#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||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=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" title="color='#90DD90'}}
   Green with 3px solid brown border
{{Legend|#C0EEC0|2px green dotted border|css=border:2px dotted #408040" title="color=#C0EEC0}}
   2px green dotted border
{{Legend|white|2px green dashed border|css=border:2px dashed #408040" title="color=white}}
   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|css=opacity:.5}}
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
Template:0 Legend tables transcluded by {{Legtab}} or {{ColorString}}: possibility for more fields, separated by slashes or pipes
Template:Tle: Template:Legtab
Template:Tle: Template:Legtab

Template parameters

ParameterDescriptionDefaultStatus
1color (CSS colors list)whiterequired
2captionemptyrequired
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:.25emptyoptional
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 3emptyoptional
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

Localization

This template is not intended to be localized.

See also

  • {{Legend-small}}, a copy of {{Legend|en}} from Wikipedia, which appearance is different than {{Legend}} on Commons (smaller boxes)