Add invalid value to color-format exception
This commit is contained in:
parent
c70ab29ae8
commit
f9bbdc3d38
|
@ -136,7 +136,7 @@ public class Color {
|
|||
val.charAt(0) + val.charAt(0) + val.charAt(1) + val.charAt(1) +
|
||||
val.charAt(2) + val.charAt(2) + val.charAt(3) + val.charAt(3);
|
||||
if (val.length() == 6) val = val + "ff";
|
||||
if (val.length() != 8) throw new NumberFormatException("Invalid color format!");
|
||||
if (val.length() != 8) throw new NumberFormatException("Invalid color format: '" + val + "'!");
|
||||
val = val.substring(6, 8) + val.substring(0, 6); // move alpha to front
|
||||
return Integer.parseUnsignedInt(val, 16);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue