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

Method colorToString2

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

Converts a Color into a string ("Red", "Green", #aa55ff, etc.). If color is null , returns the String "None".

(Color color)

Source from the content-addressed store, hash-verified

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).

Callers 5

showDialogMethod · 0.95
arrowToolOptionsMethod · 0.95
setColorMethod · 0.95
showDialogMethod · 0.95
showDialogMethod · 0.95

Calls 2

getColorNameMethod · 0.95
getHexStringMethod · 0.95

Tested by

no test coverage detected