Template:Legend

From Cannabis
Jump to navigation Jump to search

Sources: wikipedia:Template:Legend and commons:Template:Legend

██ 

Shows a legend row with a colored box.

Usage
{{legend|color|label|border=border}}

color is passed to the css background property, so it can also include images. The optional border argument (e.g. 1px solid #aaa) is passed to the css border property.

Example
{{legend|black|Africa}}
{{legend|green|Americas}}
{{legend|blue|Oceania}}
{{legend|#ff0|Europe}}
{{legend|#ff2800|Asia}}


██ Africa

██ Americas

██ Oceania

██ Europe

██ Asia

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.