Configuring the WeatherTrack color scheme
In WeatherTrack the background color for displaying weather layers is configured in a .wtpalette file. This file is in the form of an Apple XML property list, and the top level element is of type dictionary.
The keys for the dictionary are shortcuts for a particular weather layer. The key will also determine the units expected for the values of the color palette. Please note that the displayed value may be different, depending upon user settings. For example even if the user has set temperature to Fahrenheit all internal calculations happen in Celsius.
The currently available weather layers include:
- AIRTMP - Air temperature in Celsius
- CAPE - Convective available potential energy in J/kg
- CIN - Convective inhibition in J/kg
- CURRENT - Current in knots
- DPT - Dew point in Celsius
- GUST - Wind gusts in knots
- PRMSL - Pressure at sea level in hPa
- RAIN - Precipitation in mm
- RH - Relative humidity in percent
- SEATMP - Sea temperature in Celsius
- TCDC - Total cloud cover in percent
- WAV - Wave height in m
- WCAP_PRB - White cap probability in percent
- WIND - Wind speed in knots
Each of these may also be suffixed by ~ipad (e.g. AIRTMP~ipad) to make a different color scheme for the iPad. Due to small screen height on the iPhone in landscape view not very many colors fit into the map key without overflowing.
Each of the weather layers is represented as a dictionary with the following possible keys in it:
- alias - a string pointing to another parameter
- colorValues - an array of dicts specifying the color palette (required)
- cutOffIndex - an integer referencing into the above array, do not print numbers for values below that index.
- invertHiIndex - an integer referencing into the above array
- invertLoIndex - “
The alias key allows one parameter to use the color values of another parameter, for example to use the same colors for WIND and GUST, the GUST may have an alias with WIND as the string value. This feature is supported since WeatherTrack 1.6.16.
The values invertHiIndex and invertLoIndex are hints to use different color for the number values for better readability above and below the referenced value. Only layers that print numbers on the map like cloud cover or rain use the keys cutOffIndex, invertLoIndex or invertHiIndex.
The colorValues array consists of a dictionary entries having the following keys in it:
- color - The RGB color value in hex (e.g. A7C2E0)
- val - a value of the parameter or “inf” for infinity
The colorValues array is required to be sorted in ascending order, and is searched with the incoming parameter value to find a display color. If the incoming value is less than the current val value, the associated color is used. Otherwise the search continues with the next array element. For example the following excerpt for WIND is used as follows:
<key>WIND</key> <dict> <key>colorValues</key> <array> <dict> <key>color</key> <string>FFFFFF</string> <key>val</key> <string>5</string> </dict> <dict> <key>color</key> <string>E2EBF5</string> <key>val</key> <string>10</string> </dict> ... <dict> <key>color</key> <string>C80000</string> <key>val</key> <string>50</string> </dict> <dict> <key>color</key> <string>CC00CC</string> <key>val</key> <string>inf</string> </dict> </array> </dict>
If the wind speed is less than 5 knots, the color value FFFFFF is used, for wind speeds less 10 knots but more than 5 knots the color E2EBF5 will be used. As a catch all the color CC00CC will be used for wind speeds above 50 knots.
Installing a .wtpalette file
These files can be used via “Open in…” to open the .wtpalette file in WeatherTrack, for example from the iOS mail program to open an attachment from a mail message. Dropbox can also be used to easily share the file from a desktop PC. WeatherTrack copies the .wtpalette file into the Documents and remembers the last imported file as the color scheme to use.
These .wtpalette files can also be managed using iTunes file sharing, where these files can be transferred to or from a desktop PC and also deleted from an iOS device.
The currently active color scheme can also be selected from Settings, where from all installed .wtpalette files can be chosen (plus another built-in WeatherTrack.wtpalette choice).
An example color palette file with a modified WIND color scheme used by the America’s Cup racing team ARTEMIS can be found here.
The color palette file from WeatherTrack version 1.6.15 can be found here.