float[] rgb = color.getRGBColorComponents( null ); double r = rgb[0]; double g = rgb[1];
float[] colorComponents = routeColorColor.getRGBColorComponents(null);
/** * This will set interior color of the drawn area. * * @param color The interior color of the circle. */ public final void setInteriorColor(Color color) { COSArray array = null; if (color != null) { float[] colors = color.getRGBColorComponents(null); array = new COSArray(); array.setFloatArray(colors); } annot.setItem(COSName.IC, array); }
/** * This will set interior color of the drawn area. * * @param color The interior color of the circle. */ public final void setInteriorColor(Color color) { COSArray array = null; if (color != null) { float[] colors = color.getRGBColorComponents(null); array = new COSArray(); array.setFloatArray(colors); } annot.setItem(COSName.IC, array); }
/** * This will set interior color of the line endings defined in the LE entry. * * @param color The interior color of the line endings. */ public void setInteriorColor(Color color) { COSArray array = null; if (color != null) { float[] colors = color.getRGBColorComponents(null); array = new COSArray(); array.setFloatArray(colors); } annot.setItem(COSName.IC, array); }
/** * Set the annotation color. * * @param c The annotation color. */ public final void setColor(Color c) { COSArray color = null; if (c != null) { float[] colors = c.getRGBColorComponents(null); color = new COSArray(); color.setFloatArray(colors); } annot.setItem(COSName.C, color); }
/** * This will set interior color of the drawn area. * * @param color The interior color of the drawn area. */ public final void setInteriorColor(Color color) { COSArray array = null; if (color != null) { float[] colors = color.getRGBColorComponents(null); array = new COSArray(); array.setFloatArray(colors); } annot.setItem(COSName.IC, array); }
/** * This will set interior color of the line endings defined in the LE entry. * * @param color The interior color of the line endings. */ public final void setInteriorColor(Color color) { COSArray array = null; if (color != null) { float[] colors = color.getRGBColorComponents(null); array = new COSArray(); array.setFloatArray(colors); } annot.setItem(COSName.IC, array); }
public Color build() { final float[] rgb = this.color.getRGBColorComponents(null); return new Color(rgb[0], rgb[1], rgb[2], this.opacity); }
public static float[] getRGBColorComponents(Color color) { float[] comps = componentsCache.get(color); if (comps == null) { comps = color.getRGBColorComponents(null); componentsCache.put(color, comps); } return comps; }
public static Color dimmer(@NotNull Color color) { float[] rgb = color.getRGBColorComponents(null); float alpha = 0.80f; float rem = 1 - alpha; return new Color(rgb[0] * alpha + rem, rgb[1] * alpha + rem, rgb[2] * alpha + rem); }
public static Color dimmer(@NotNull Color color) { float[] rgb = color.getRGBColorComponents(null); float alpha = 0.80f; float rem = 1 - alpha; return new Color(rgb[0] * alpha + rem, rgb[1] * alpha + rem, rgb[2] * alpha + rem); }
@Override public void update( Stroke obj, String val ) { // keep original color float alpha = Float.parseFloat( val ); float[] cols = obj.color.getRGBColorComponents( null ); obj.color = new Color( cols[0], cols[1], cols[2], alpha ); } }, contn ).second;
private Color getAlphaColor(Color fcolor) { Color ac = alphaColors.get(fcolor); if (ac == null) { float[] rgb = new float[3]; rgb = fcolor.getRGBColorComponents(rgb); ac = new Color(rgb[0], rgb[1], rgb[2], 0.1f); alphaColors.put(fcolor, ac); } return ac; }
@Override public void update( Fill obj, String val ) { // keep original color float alpha = max( 0, min( 1, parseFloat( val ) ) ); float[] cols = obj.color.getRGBColorComponents( null ); obj.color = new Color( cols[0], cols[1], cols[2], alpha ); } }, contn ).second;
public void getColorRGB(StringBuilder buf) { float[] rgb = color.getRGBColorComponents(null); buf.append(Float.toString(rgb[0] * 100)); buf.append("%, "); buf.append(Float.toString(rgb[1] * 100)); buf.append("%, "); buf.append(Float.toString(rgb[2] * 100)); buf.append("%"); }
/** * java.awt.Color. Forward the call to the delegate. */ public float[] getRGBColorComponents(float[] compArray) { return getColor().getRGBColorComponents(compArray); }
private Color multiply(Color color1, Color color2) { float[] color1Components = color1.getRGBComponents(null); float[] color2Components = color2.getRGBColorComponents(null); float[] newComponents = new float[3]; for(int i = 0; i < 3; i++) newComponents[i] = color1Components[i] * color2Components[i]; return new Color(newComponents[0], newComponents[1], newComponents[2], color1Components[3]); }
private static Color toSRGBColor(Color color) { float[] comps; ColorSpace sRGB = ColorSpace.getInstance(ColorSpace.CS_sRGB); comps = color.getRGBColorComponents(null); float[] allComps = color.getComponents(null); float alpha = allComps[allComps.length - 1]; //Alpha is on last component return new Color(sRGB, comps, alpha); }
@Override public float[] getRGBColorComponents(float[] compArray) { final Color c = getColor(); return c == this ? super.getRGBComponents(compArray) : c.getRGBColorComponents(compArray); }