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

Method hexToColor

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

Converts a hex color (e.g., "ffff00") into "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

190 * Returns null if the hex color does not have a name.
191 * Unused in ImageJ, for compatibility only. */
192 public static String hexToColor(String hex) {
193 if (hex==null) return null;
194 Color color = decode(hex, null);
195 if (color==null) return null;
196 return getColorName(color, null, false);
197 }
198
199 /** Converts a hex color (e.g., "ffff00" or "#ffff00") into a color name
200 * "Red", "Green", "Yellow", etc.

Callers

nothing calls this directly

Calls 2

decodeMethod · 0.95
getColorNameMethod · 0.95

Tested by

no test coverage detected