java.lang.Object
ij.plugin.Colors
- All Implemented Interfaces:
PlugIn
,java.awt.event.ItemListener
,java.util.EventListener
public class Colors extends java.lang.Object implements PlugIn, java.awt.event.ItemListener
This plugin implements most of the Edit/Options/Colors command.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
colors
-
Constructor Summary
Constructors Constructor Description Colors()
-
Method Summary
Modifier and Type Method Description static java.lang.String
colorToString(java.awt.Color color)
Converts a Color into a string ("red", "green", #aa55ff, etc.).static java.lang.String
colorToString2(java.awt.Color color)
Converts a Color into a string ("Red", "Green", #aa55ff, etc.).static java.awt.Color
decode(java.lang.String hexColor)
static java.awt.Color
decode(java.lang.String hexColor, java.awt.Color defaultColor)
static int
getBlue(java.lang.String hexColor)
static java.awt.Color
getColor(java.lang.String name, java.awt.Color defaultColor)
static java.lang.String
getColorName(java.awt.Color c, java.lang.String defaultName)
static java.lang.String[]
getColors(java.lang.String... moreColors)
static int
getGreen(java.lang.String hexColor)
static int
getRed(java.lang.String hexColor)
static java.lang.String
hexToColor(java.lang.String hex)
Converts a hex color (e.g., "ffff00") into "red", "green", "yellow", etc.static java.lang.String
hexToColor2(java.lang.String hex)
Converts a hex color (e.g., "ffff00") into "Red", "Green", "Yellow", etc.void
itemStateChanged(java.awt.event.ItemEvent e)
void
run(java.lang.String arg)
This method is called when the plugin is loaded.static java.awt.Color
toColor(int red, int green, int blue)
-
Field Details
-
colors
public static final java.lang.String[] colors
-
-
Constructor Details
-
Colors
public Colors()
-
-
Method Details
-
run
public void run(java.lang.String arg)Description copied from interface:PlugIn
This method is called when the plugin is loaded. 'arg', which may be blank, is the argument specified for this plugin in IJ_Props.txt. -
getColorName
public static java.lang.String getColorName(java.awt.Color c, java.lang.String defaultName) -
getColor
public static java.awt.Color getColor(java.lang.String name, java.awt.Color defaultColor) -
decode
public static java.awt.Color decode(java.lang.String hexColor) -
decode
public static java.awt.Color decode(java.lang.String hexColor, java.awt.Color defaultColor) -
getRed
public static int getRed(java.lang.String hexColor) -
getGreen
public static int getGreen(java.lang.String hexColor) -
getBlue
public static int getBlue(java.lang.String hexColor) -
hexToColor
public static java.lang.String hexToColor(java.lang.String hex)Converts a hex color (e.g., "ffff00") into "red", "green", "yellow", etc. Returns null if the color is not one of the eight primary colors. -
hexToColor2
public static java.lang.String hexToColor2(java.lang.String hex)Converts a hex color (e.g., "ffff00") into "Red", "Green", "Yellow", etc. Returns null if the color is not one of the eight primary colors. -
colorToString
public static java.lang.String colorToString(java.awt.Color color)Converts a Color into a string ("red", "green", #aa55ff, etc.). -
colorToString2
public static java.lang.String colorToString2(java.awt.Color color)Converts a Color into a string ("Red", "Green", #aa55ff, etc.). -
toColor
public static java.awt.Color toColor(int red, int green, int blue) -
itemStateChanged
public void itemStateChanged(java.awt.event.ItemEvent e)- Specified by:
itemStateChanged
in interfacejava.awt.event.ItemListener
-
getColors
public static java.lang.String[] getColors(java.lang.String... moreColors)
-