mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-21 21:57:56 +01:00
allow null value to rgbToHex method
This commit is contained in:
parent
268f3cfecf
commit
a4da6fb7cd
@ -357,6 +357,7 @@ public class FreemindExporter
|
||||
|
||||
private String rgbToHex(String color) {
|
||||
String result = color;
|
||||
if (color != null) {
|
||||
boolean isRGB = Pattern.matches("^rgb\\([0-9]{1,3}, [0-9]{1,3}, [0-9]{1,3}\\)$", color);
|
||||
if (isRGB) {
|
||||
String[] rgb = color.substring(4, color.length() - 1).split(",");
|
||||
@ -365,6 +366,7 @@ public class FreemindExporter
|
||||
Integer b = Integer.valueOf(rgb[2].trim());
|
||||
result = String.format("#%02x%02x%02x", r, g, b);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user