Key:colour

From OpenStreetMap Wiki
Jump to navigation Jump to search
Public-images-osm logo.svg colour
Prague metro plan 2008.svg
Description
The colour associated with the object Show/edit corresponding data item.
Group: annotations
Used on these elements
may be used on nodesmay be used on waysmay be used on areas (and multipolygon relations)may be used on relations
Useful combination
Status: de facto

Use colour=* to indicate the official colour within the sRGB gamut associated with the object, for example the colour typically associated with a public transportation route. It is also often used to describe the real colour of an object like amenity=bench.

Important note: The key uses the English spelling of "colour" and not "color" (Americanised English spelling). Refer to deprecated tags below.

How to map

The value should be:

  • an  Web RGB colour code (hex triplet), e.g. #FF0000 for red. This RGB code allows to describe about 16 millions distinct colours.
    A shorter RGB code with only 3 hex digits is also possible: it is equivalent to the 6-digit RGB codes where each individual digits (of the 3-digit code) are doubled (see examples in the table below). This short code (also standard in HTML and CSS) allows describing 4096 distinct colours.
  • a CSS colour name (mostly American English colour names) in lower case (generic names should be preferred for non-specific colours, e.g. red instead of firebrick), and without any dash separator (when using composite colour names in the "Extended colour set" in the CSS specification). The limitation to lower case is currently valid in spite of the CSS specification that says that colour names are ASCII case-insensitive.

The following 16 "basic colour names" (standardized in CSS for use in HTML and SVG) are recommended for best support in various map renderers.

Sample RGB hex W3C colour name   Sample RGB hex W3C colour name
  #000000 (or #000) black   #FFFFFF (or #FFF) white
  #808080 gray (or grey)   #C0C0C0 silver
  #800000 maroon   #FF0000 (or #F00) red
  #808000 olive   #FFFF00 (or #FF0) yellow
  #008000 green   #00FF00 (or #0F0) lime
  #008080 teal   #00FFFF (or #0FF) aqua (or cyan)
  #000080 navy   #0000FF (or #00F) blue
  #800080 purple   #FF00FF (or #F0F) fuchsia (or magenta)

A more extensive list of colour keywords has been specified by the CSS colour Module Level 3, which is supported by all major internet browsers (this list also add "colour" synonyms for British English, where the basic colour set uses American English names). However, please keep in mind that these will not be recognized by all renderers. Hex triplets as described above are preferred in this case.

Here is a list of the most used tags on taginfo:

Value may be interpretated as RGB hex
color=brown #804000
color=red #FF0000
color=yellow #FFFF00
color=gray #808080
color=green #008000
color=white #FFFFFF
color=black #000000
color=blue #0000FF
color=orange #FF8000

see more on https://taginfo.openstreetmap.org/keys/colour#values

Rendering

The colour=* key is not currently rendered in any of the featured tile layers. Despite this, continued use and application of the key encourages the chance that it may be rendered in the future. The tag is used in applications, such as OSMAnd / Organic Maps and some 3D visualisation programmes.

Deprecated tags

Note: There is also an alternative spelling color=* in lesser use for the tag name, see a comparison in Taginfo. "Color" is the alternative used in the American English spelling, however the community usually prefers to use the British spelling for consistency. This alternative name is listed in Deprecated features. However the names in value should still follow the W3C standard.

Possible tagging mistakes

If you know places with this tag, verify if it could be tagged with another tag.
Automated edits are strongly discouraged unless you really know what you are doing!
If you know places with this tag, verify if it could be tagged with another tag.
Automated edits are strongly discouraged unless you really know what you are doing!
If you know places with this tag, verify if it could be tagged with another tag.
Automated edits are strongly discouraged unless you really know what you are doing!
If you know places with this tag, verify if it could be tagged with another tag.
Automated edits are strongly discouraged unless you really know what you are doing!
If you know places with this tag, verify if it could be tagged with another tag.
Automated edits are strongly discouraged unless you really know what you are doing!
If you know places with this tag, verify if it could be tagged with another tag.
Automated edits are strongly discouraged unless you really know what you are doing!

See also