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

Method getColorName

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

For named colors, returns the name, or 'defaultName' if not a named color. If 'defaultName' is non-null and starts with an uppercase character, the returned name is capitalized (first character uppercase). Use colorToString or colorToString2 to get a String representation (hexadecimal) also for

(Color c, String defaultName)

Source from the content-addressed store, hash-verified

82 * Use colorToString or colorToString2 to get a String representation (hexadecimal)
83 * also for unnamed colors.*/
84 public static String getColorName(Color c, String defaultName) {
85 if (c==null) return defaultName;
86 boolean useCapitalizedName = defaultName!=null && defaultName.length()>0 && Character.isUpperCase(defaultName.charAt(0));
87 return getColorName(c, defaultName, useCapitalizedName);
88 }
89
90 /** For named colors, returns the name, or 'defaultName' if not a named color.
91 * 'color' must not be null. */

Callers 9

showDialogMethod · 0.95
hexToColorMethod · 0.95
hexToColor2Method · 0.95
colorToStringMethod · 0.95
colorToString2Method · 0.95
showDialogMethod · 0.95
showDialogMethod · 0.95
setColorMethod · 0.95
showDialogMethod · 0.95

Calls 3

charAtMethod · 0.80
lengthMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected