Converts a Color into a string ("Red", "Green", #aa55ff, etc.). If color is null , returns the String "None".
(Color color)
| 220 | /** Converts a Color into a string ("Red", "Green", #aa55ff, etc.). |
| 221 | * If <code>color</code> is <code>null</code>, returns the String "None". */ |
| 222 | public static String colorToString2(Color color) { |
| 223 | if (color == null) return "None"; |
| 224 | String str = getColorName(color, null, true); |
| 225 | if (str == null) |
| 226 | str = "#"+getHexString(color); |
| 227 | return str; |
| 228 | } |
| 229 | |
| 230 | /** Returns the 6-digit hex string such as "aa55ff" for opaque colors or |
| 231 | * or 8-digit like "80aa55ff" for other colors (the first two hex digits are alpha). |
no test coverage detected