Package ij.plugin
Class Colors
- java.lang.Object
-
- ij.plugin.Colors
-
- All Implemented Interfaces:
PlugIn,ItemListener,EventListener
public class Colors extends Object implements PlugIn, ItemListener
This plugin implements most of the Edit/Options/Colors command.
-
-
Constructor Summary
Constructors Constructor Description Colors()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringcolorToString(Color color)Converts a Color into a string ("red", "green", #aa55ff, etc.).static StringcolorToString2(Color color)Converts a Color into a string ("Red", "Green", #aa55ff, etc.).static Colordecode(String hexColor, Color defaultColor)static intgetBlue(String hexColor)static ColorgetColor(String name, Color defaultColor)static StringgetColorName(Color c, String defaultName)static String[]getColors(String... moreColors)static intgetGreen(String hexColor)static intgetRed(String hexColor)static StringhexToColor(String hex)Converts a hex color (e.g., "ffff00") into "red", "green", "yellow", etc.static StringhexToColor2(String hex)Converts a hex color (e.g., "ffff00") into "Red", "Green", "Yellow", etc.voiditemStateChanged(ItemEvent e)voidrun(String arg)This method is called when the plugin is loaded.
-
-
-
Field Detail
-
colors
public static final String[] colors
-
-
Method Detail
-
run
public void run(String arg)
Description copied from interface:PlugInThis method is called when the plugin is loaded. 'arg', which may be blank, is the argument specified for this plugin in IJ_Props.txt.
-
getRed
public static int getRed(String hexColor)
-
getGreen
public static int getGreen(String hexColor)
-
getBlue
public static int getBlue(String hexColor)
-
hexToColor
public static String hexToColor(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 String hexToColor2(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 String colorToString(Color color)
Converts a Color into a string ("red", "green", #aa55ff, etc.).
-
colorToString2
public static String colorToString2(Color color)
Converts a Color into a string ("Red", "Green", #aa55ff, etc.).
-
itemStateChanged
public void itemStateChanged(ItemEvent e)
- Specified by:
itemStateChangedin interfaceItemListener
-
-