float[] rgbaf = color.getRGBComponents(null); boolean addAlpha = (rgbaf.length == 4 && rgbaf[3] < 1f); CTPositiveFixedPercentage alphaPct;
public static Color screen(Color color1, Color color2) { float[] components1 = color1.getRGBComponents(null); float[] components2 = color2.getRGBComponents(null); float[] components = new float[4]; for (int i = 0; i < 4; i++) { components[i] = 1.0f - (1.0f - components1[i]) * (1.0f - components2[i]); } return new Color(components[0], components[1], components[2], components[3]); }
protected Color interpolateColor(float t, Color start, Color end) { float[] partsS = start.getRGBComponents(null); float[] partsE = end.getRGBComponents(null); float[] partsR = new float[4]; for(int i=0; i<4; i++) { partsR[i] = (partsS[i] - partsE[i])*t + partsE[i]; } return new Color(partsR[0],partsR[1],partsR[2],partsR[3]); }
protected Color interpolateColor(float t, Color start, Color end) { float[] partsS = start.getRGBComponents(null); float[] partsE = end.getRGBComponents(null); float[] partsR = new float[4]; for(int i=0; i<4; i++) { partsR[i] = (partsS[i] - partsE[i])*t + partsE[i]; } return new Color(partsR[0],partsR[1],partsR[2],partsR[3]); }
public static Color multiply(Color color1, Color color2) { float[] components1 = color1.getRGBComponents(null); float[] components2 = color2.getRGBComponents(null); float[] components = new float[4]; for (int i = 0; i < 4; i++) { components[i] = components1[i] * components2[i]; } return new Color(components[0], components[1], components[2], components[3]); }
public static Color screen(Color color1, Color color2) { float[] components1 = color1.getRGBComponents(null); float[] components2 = color2.getRGBComponents(null); float[] components = new float[4]; for (int i = 0; i < 4; i++) { components[i] = 1.0f - (1.0f - components1[i]) * (1.0f - components2[i]); } return new Color(components[0], components[1], components[2], components[3]); }
protected Color interpolateColor(float t, Color start, Color end) { float[] partsS = start.getRGBComponents(null); float[] partsE = end.getRGBComponents(null); float[] partsR = new float[4]; for (int i = 0; i < 4; i++) { partsR[i] = (partsS[i] - partsE[i]) * t + partsE[i]; } return new Color(partsR[0], partsR[1], partsR[2], partsR[3]); }
protected Color interpolateColor(float t, Color start, Color end) { float[] partsS = start.getRGBComponents(null); float[] partsE = end.getRGBComponents(null); float[] partsR = new float[4]; for(int i=0; i<4; i++) { partsR[i] = (partsS[i] - partsE[i])*t + partsE[i]; } return new Color(partsR[0],partsR[1],partsR[2],partsR[3]); }
public static Color add(Color color1, Color color2) { float[] components1 = color1.getRGBComponents(null); float[] components2 = color2.getRGBComponents(null); float[] components = new float[4]; for (int i = 0; i < 4; i++) { components[i] = Math.min(components1[i] + components2[i], 1.0f); } return new Color(components[0], components[1], components[2], components[3]); }
/** * Returns a Color based on the param which is not of type UIResource. * * @param color the base color * @return a color not of type UIResource, may be null. */ public static Color getAsNotUIResource(Color color) { if (!(color instanceof UIResource)) return color; // PENDING JW: correct way to create another color instance? float[] rgb = color.getRGBComponents(null); return new Color(rgb[0], rgb[1], rgb[2], rgb[3]); }
/** * Returns a Color based on the param which is not of type UIResource. * * @param color the base color * @return a color not of type UIResource, may be null. */ private Color getAsNotUIResource(Color color) { if (!(color instanceof UIResource)) return color; // PENDING JW: correct way to create another color instance? float[] rgb = color.getRGBComponents(null); return new Color(rgb[0], rgb[1], rgb[2], rgb[3]); }
public static Color add(Color color1, Color color2) { float[] components1 = color1.getRGBComponents(null); float[] components2 = color2.getRGBComponents(null); float[] components = new float[4]; for (int i = 0; i < 4; i++) { components[i] = Math.min(components1[i] + components2[i], 1.0f); } return new Color(components[0], components[1], components[2], components[3]); }
/** * Returns a Color based on the param which is not of type UIResource. * * @param color the base color * @return a color not of type UIResource, may be null. */ public static Color getAsNotUIResource(Color color) { if (!(color instanceof UIResource)) return color; // PENDING JW: correct way to create another color instance? float[] rgb = color.getRGBComponents(null); return new Color(rgb[0], rgb[1], rgb[2], rgb[3]); }
@Override public float[] getRGBComponents(float[] compArray) { final Color c = getColor(); return c == this ? super.getRGBComponents(compArray) : c.getRGBComponents(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 Color oppositeColor(Color c) { float[] rgb = new float[4]; c.getRGBComponents(rgb); rgb[0] = Math.abs(rgb[0] - 255); rgb[1] = Math.abs(rgb[1] - 255); rgb[2] = Math.abs(rgb[2] - 255); return Color.getHSBColor(rgb[0], rgb[1], rgb[2]); }
public void setBackgroundColor(Color backgroundColor) { this.backgroundColor = backgroundColor; this.backgroundColorComponents = backgroundColor.getRGBComponents(this.backgroundColorComponents); fireProperyChange("backgroundColor", null, backgroundColor); }
@Override public float[] getRGBColorComponents(float[] compArray) { final Color c = getColor(); return c == this ? super.getRGBComponents(compArray) : c.getRGBColorComponents(compArray); }
public Rectangle() { drawable = VizController.getInstance().getDrawable(); config = VizController.getInstance().getVizConfig(); color = config.getRectangleSelectionColor().getRGBComponents(null); }
private void defaultValues() { VizConfig vizConfig = VizController.getInstance().getVizConfig(); showNodeLabels = vizConfig.isDefaultShowNodeLabels(); showEdgeLabels = vizConfig.isDefaultShowEdgeLabels(); nodeFont = vizConfig.getDefaultNodeLabelFont(); edgeFont = vizConfig.getDefaultEdgeLabelFont(); nodeColor = vizConfig.getDefaultNodeLabelColor().getRGBComponents(null); edgeColor = vizConfig.getDefaultEdgeLabelColor().getRGBComponents(null); selectedOnly = vizConfig.isDefaultShowLabelOnSelectedOnly(); colorMode = VizController.getInstance().getTextManager().getColorModes()[2]; sizeMode = VizController.getInstance().getTextManager().getSizeModes()[1]; }