AbstractHafasClientInterfaceProvider: Derive missing foreground colors in 'icoL'.

This commit is contained in:
Andreas Schildbach 2019-01-09 12:40:58 +01:00
parent eb026a965f
commit d92989cbe7

View file

@ -907,7 +907,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
final JSONObject ico = icoList.getJSONObject(i);
if (ico.has("bg")) {
final int background = parseIcoColor(ico.getJSONObject("bg"));
final int foreground = parseIcoColor(ico.getJSONObject("fg"));
final JSONObject fg = ico.optJSONObject("fg");
final int foreground = fg != null ? parseIcoColor(fg) : Style.deriveForegroundColor(background);
final String shp = ico.optString("shp", null);
if (shp == null) {
styles.add(new Style(background, foreground));