ij.plugin
Class Colors

java.lang.Object
  extended by 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.


Field Summary
static String[] colors
           
 
Constructor Summary
Colors()
           
 
Method Summary
static String colorToString(Color color)
          Converts a Color into a string ("red", "green", #aa55ff, etc.).
static String colorToString2(Color color)
          Converts a Color into a string ("Red", "Green", #aa55ff, etc.).
static Color decode(String hexColor, Color defaultColor)
           
static int getBlue(String hexColor)
           
static Color getColor(String name, Color defaultColor)
           
static String getColorName(Color c, String defaultName)
           
static String[] getColors(String... moreColors)
           
static int getGreen(String hexColor)
           
static int getRed(String hexColor)
           
static String hexToColor(String hex)
          Converts a hex color (e.g., "ffff00") into "red", "green", "yellow", etc.
static String hexToColor2(String hex)
          Converts a hex color (e.g., "ffff00") into "Red", "Green", "Yellow", etc.
 void itemStateChanged(ItemEvent e)
           
 void run(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
 

Field Detail

colors

public static final String[] colors
Constructor Detail

Colors

public Colors()
Method Detail

run

public void run(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 String getColorName(Color c,
                                  String defaultName)

getColor

public static Color getColor(String name,
                             Color defaultColor)

decode

public static Color decode(String hexColor,
                           Color defaultColor)

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:
itemStateChanged in interface ItemListener

getColors

public static String[] getColors(String... moreColors)


Copyright © 1997–2015 NIH. All rights reserved.