private Color getChannelColor(int colorCode) { switch (colorCode) { case 0: // red return new Color(255, 0, 0, 255); case 1: // green return new Color(0, 255, 0, 255); case 2: // blue return new Color(0, 0, 255, 255); case 3: // cyan return new Color(0, 255, 255, 255); case 4: // magenta return new Color(255, 0, 255, 255); case 5: // yellow return new Color(255, 255, 0, 255); } return new Color(255, 255, 255, 255); }
/** * Returns the alpha component of this color. * * @return See above. */ public int getAlpha() { return getValue() & 0xff; }
@Override public void setMaskStrokeColor(Color stroke, int roiIndex, int shapeIndex) { Mask o = getMask(roiIndex, shapeIndex); if (o != null) { java.awt.Color javaColor = new java.awt.Color( stroke.getRed(), stroke.getGreen(), stroke.getBlue(), stroke.getAlpha()); o.setStrokeColor(rint(javaColor.getRGB())); } }
@Override public short[][] get16BitLookupTable() throws FormatException, IOException { FormatTools.assertId(currentId, true, 1); if (lut == null || lut[getSeries()] == null || getPixelType() != FormatTools.UINT16 || channelColor == null) { return null; } short[][] s = new short[3][65536]; Color color = channelColor[prevChannel]; for (int j=0; j<s[0].length; j++) { s[0][j] = (short) ((color.getRed() / 255.0) * j); s[1][j] = (short) ((color.getGreen() / 255.0) * j); s[2][j] = (short) ((color.getBlue() / 255.0) * j); } return s; }
Well_element.setAttribute("Color", color.toString());
@Override public short[][] get16BitLookupTable() throws FormatException, IOException { FormatTools.assertId(currentId, true, 1); if (lut == null || lut[getSeries()] == null || getPixelType() != FormatTools.UINT16 || channelColor == null) { return null; } short[][] s = new short[3][65536]; Color color = channelColor[prevChannel]; for (int j=0; j<s[0].length; j++) { s[0][j] = (short) ((color.getRed() / 255.0) * j); s[1][j] = (short) ((color.getGreen() / 255.0) * j); s[2][j] = (short) ((color.getBlue() / 255.0) * j); } return s; }
setColor(Color.valueOf( element.getAttribute("Color")));
Well_element.setAttribute("Color", color.toString());
private Color getChannelColor(int colorCode) { switch (colorCode) { case 0: // red return new Color(255, 0, 0, 255); case 1: // green return new Color(0, 255, 0, 255); case 2: // blue return new Color(0, 0, 255, 255); case 3: // cyan return new Color(0, 255, 255, 255); case 4: // magenta return new Color(255, 0, 255, 255); case 5: // yellow return new Color(255, 255, 0, 255); } return new Color(255, 255, 255, 255); }
/** * Returns the red component of this color. * * @return See above. */ public int getRed() { return (getValue() >> 24) & 0xff; }
setColor(Color.valueOf( element.getAttribute("Color")));
/** * Returns an <code>Color</code> object holding the value of * the specified string. * @param s The string to be parsed. * @return See above. */ public static Color valueOf(String s) { return new Color(Integer.valueOf(s)); }
/** * Returns the red component of this color. * * @return See above. */ public int getRed() { return (getValue() >> 24) & 0xff; }