Fixed: #2381 Font color values with alpha allowed in html edittext, but alpha ignored

This commit is contained in:
Jindra Petřík
2025-01-17 21:47:12 +01:00
parent 79042fd098
commit 1d3fbf0f16
4 changed files with 46 additions and 7 deletions
@@ -6393,8 +6393,14 @@ public class XFLConverter {
}
String c = attributes.getValue("color");
if (c != null) {
color = c;
colorAlpha = 255;
if (c.matches("^#[0-9a-fA-F]{8}$")) {
color = "#" + c.substring(3);
} else if (c.matches("^#[0-9a-fA-F]{6}$")) {
color = c;
colorAlpha = 255;
} else {
//wrong format, do not change color
}
}
String f = attributes.getValue("face");
if (f != null) {