Added color workarounds

This commit is contained in:
M66B 2020-01-21 11:06:26 +01:00
parent 1b0e8d70a9
commit f9762dd014
1 changed files with 6 additions and 1 deletions

View File

@ -180,6 +180,7 @@ public class HtmlHelper {
switch (key) { switch (key) {
case "color": case "color":
String c = value String c = value
.replace("none", "")
.replace("inherit", "") .replace("inherit", "")
.replace("initial", "") .replace("initial", "")
.replace("windowtext", "") .replace("windowtext", "")
@ -207,7 +208,11 @@ public class HtmlHelper {
} else if (c.equals("orange")) } else if (c.equals("orange"))
color = 0Xffa500; // CSS Level 2 color = 0Xffa500; // CSS Level 2
else else
try {
color = Color.parseColor(c); color = Color.parseColor(c);
} catch (IllegalArgumentException ex) {
color = Color.parseColor("#" + c);
}
} catch (Throwable ex) { } catch (Throwable ex) {
Log.e("Color=" + c); Log.e("Color=" + c);
} }