diff options
-rw-r--r-- | poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelUtils.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelUtils.java b/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelUtils.java index a4f9b13e23..9d85fea971 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelUtils.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelUtils.java @@ -113,13 +113,13 @@ class AbstractExcelUtils { StringBuilder stringBuilder = new StringBuilder(7); stringBuilder.append('#'); for (short s : color.getTriplet()) { - if (s < 10) { + String hex = Integer.toHexString(s); + if (hex.length() == 1) { stringBuilder.append('0'); } - - stringBuilder.append(Integer.toHexString(s)); + stringBuilder.append(hex); } - String result = stringBuilder.toString(); + String result = color.getHexString(); if (result.equals("#ffffff")) { return "white"; |