ij.plugin
Class Colors
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 |
static java.lang.String[] |
colors
|
Method Summary |
static java.lang.String |
colorToString(java.awt.Color color)
Converts a Color into a string ("red", "green", #aa55ff, etc.). |
static java.awt.Color |
decode(java.lang.String hexColor,
java.awt.Color defaultColor)
|
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 |
hexToColor(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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
colors
public static final java.lang.String[] colors
Colors
public Colors()
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.
- Specified by:
run
in interface PlugIn
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,
java.awt.Color defaultColor)
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.
colorToString
public static java.lang.String colorToString(java.awt.Color color)
- Converts a Color into a string ("red", "green", #aa55ff, etc.).
itemStateChanged
public void itemStateChanged(java.awt.event.ItemEvent e)
- Specified by:
itemStateChanged
in interface java.awt.event.ItemListener