mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-04 03:43:55 +01:00
Added color workaround
This commit is contained in:
@@ -673,9 +673,13 @@ public class HtmlHelper {
|
|||||||
try {
|
try {
|
||||||
if (TextUtils.isEmpty(c))
|
if (TextUtils.isEmpty(c))
|
||||||
return null;
|
return null;
|
||||||
else if (c.startsWith("#"))
|
else if (c.startsWith("#")) {
|
||||||
color = Integer.decode(c) | 0xFF000000;
|
String code = c.substring(1);
|
||||||
else if (c.startsWith("rgb") || c.startsWith("hsl")) {
|
if (x11ColorMap.containsKey(code)) // workaround
|
||||||
|
color = x11ColorMap.get(code) | 0xFF000000;
|
||||||
|
else
|
||||||
|
color = Integer.decode(c) | 0xFF000000;
|
||||||
|
} else if (c.startsWith("rgb") || c.startsWith("hsl")) {
|
||||||
int s = c.indexOf("(");
|
int s = c.indexOf("(");
|
||||||
int e = c.indexOf(")");
|
int e = c.indexOf(")");
|
||||||
if (s > 0 && e > s) {
|
if (s > 0 && e > s) {
|
||||||
@@ -706,6 +710,7 @@ public class HtmlHelper {
|
|||||||
try {
|
try {
|
||||||
color = Color.parseColor(c);
|
color = Color.parseColor(c);
|
||||||
} catch (IllegalArgumentException ex) {
|
} catch (IllegalArgumentException ex) {
|
||||||
|
// Workaround
|
||||||
color = Integer.decode("#" + c) | 0xFF000000;
|
color = Integer.decode("#" + c) | 0xFF000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user