From f9762dd0148dc004cdb67fb058d37cdd33fa8c52 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 21 Jan 2020 11:06:26 +0100 Subject: [PATCH] Added color workarounds --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index c43a9cdf4c..6ac869ccb8 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -180,6 +180,7 @@ public class HtmlHelper { switch (key) { case "color": String c = value + .replace("none", "") .replace("inherit", "") .replace("initial", "") .replace("windowtext", "") @@ -207,7 +208,11 @@ public class HtmlHelper { } else if (c.equals("orange")) color = 0Xffa500; // CSS LevelĀ 2 else - color = Color.parseColor(c); + try { + color = Color.parseColor(c); + } catch (IllegalArgumentException ex) { + color = Color.parseColor("#" + c); + } } catch (Throwable ex) { Log.e("Color=" + c); }