MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / hexToColor2

Method hexToColor2

ij/src/main/java/ij/plugin/Colors.java:203–208  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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". */

Callers

nothing calls this directly

Calls 2

decodeMethod · 0.95
getColorNameMethod · 0.95

Tested by

no test coverage detected