Create a Hiking Path Symbol Renderer. Step 2: Colors
Welcome to Marble, a virtual globe and world atlas that runs on Linux, Windows, MacOS and Android. Find your way and explore the world! :-)
This task is closely related to Marble, but you can do it without it. All you need is a development environment with C++ and Qt installed, and the code from the task "Create a Hiking Path Symbol Renderer. Step 1: Basics".
Hiking routes in in OpenStreetMap have an optional tag osmc:symbol which contains a textual, machine-readable description of an image. This task is about extending the tool from "Step 1: Basics" to support all the colors osmc:symbols can have.
- Add a method to split the string passed by the user into the different fields (hint: QString::split() is probably great for this)
- Use the extracted color values and transform them into QColor instances. QColor::setNamedColor() is probably enough to accomplish this. It's fine to support more color values than the osmc:symbol specification mentions
- Background will always be a solid fill color and foreground a bar for this task
Test your application using different colors. Pass symbols like these:
red:white:red_bar:FW:gray
yellow:brown:blue_bar:marble:orange
red:yellow:green_bar:foo:purple
green:white:invalid_bar:GCI:black
red:yellow_broken:green_bar:foo:purple
red:green:
totally no symbol
Got a question or a problem you cannot solve on your own? Please contact your mentors:
- Using live chat via the #marble IRC channel in Freenode
- By mail using nienhueser@kde.org and rahn@kde.org