/** * Method that may be used to get RGB colors. * Classes that only provide RGB images may call this from their getDefaultChannelColors method. * * @param channel * @return */ protected Integer getDefaultRGBChannelColors(int channel) { if (nChannels() == 1) return ColorTools.makeRGB(255, 255, 255); switch (channel) { case 0: return ColorTools.makeRGB(255, 0, 0); case 1: return ColorTools.makeRGB(0, 255, 0); case 2: return ColorTools.makeRGB(0, 0, 255); default: return ColorTools.makeRGB(255, 255, 255); } }
/** * Similar to getDefaultRGBChannelColors, but including Magenta, Cyan & Yellow to return colors for up to 6 channels. * If only one channel is present, or a channel number > 6 is requested, Color.WHITE is returned. * * @param channel * @return */ protected Integer getExtendedDefaultChannelColor(int channel) { if (nChannels() == 1) return ColorTools.makeRGB(255, 255, 255); switch (channel) { case 0: return ColorTools.makeRGB(255, 0, 0); case 1: return ColorTools.makeRGB(0, 255, 0); case 2: return ColorTools.makeRGB(0, 0, 255); case 3: return ColorTools.makeRGB(255, 255, 0); case 4: return ColorTools.makeRGB(0, 255, 255); case 5: return ColorTools.makeRGB(255, 255, 0); default: return ColorTools.makeRGB(255, 255, 255); } }