OsmColors

object OsmColors

Maps OSM tags to a wall Color. Tries, in order:

  1. building:colour or colour parsed as #RRGGBB/#RGB/CSS-name.

  2. building:material mapped via a small lookup table.

  3. A category tint inferred from historic / tourism / amenity / certain building=* values (so e.g. museums, churches, and town halls read differently from generic residential at-a-glance).

Returns null when nothing matches, leaving the caller free to use a default. The lookup tables stay small on purpose — they cover what's frequently tagged in OSM. Unknown values are treated as "no opinion" rather than guessed at.

Functions

Link copied to clipboard
fun parseColor(raw: String?): Color?

Accepts #RRGGBB, #RGB, #RRGGBBAA, or a CSS-style name from NAMED.

Link copied to clipboard
fun resolve(tags: Map<String, String>): Color?