Converts a hex color (e.g., "ffff00" or "#ffff00") into a color name "Red", "Green", "Yellow", etc. Returns null if the hex color does not have a name. Unused in ImageJ, for compatibility only.
(String hex)
| 201 | * Returns null if the hex color does not have a name. |
| 202 | * Unused in ImageJ, for compatibility only. */ |
| 203 | public static String hexToColor2(String hex) { |
| 204 | if (hex==null) return null; |
| 205 | Color color = decode(hex, null); |
| 206 | if (color==null) return null; |
| 207 | return getColorName(color, null, true); |
| 208 | } |
| 209 | |
| 210 | /** Converts a Color into a lowercase string ("red", "green", "#aa55ff", etc.). |
| 211 | * If <code>color</code> is <code>null</code>, returns the String "none". */ |
nothing calls this directly
no test coverage detected