Java Code Examples for org.pushingpixels.substance.internal.utils.SubstanceColorUtilities

The following examples show how to use org.pushingpixels.substance.internal.utils.SubstanceColorUtilities. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * Creates a new <code>Graphite</code> skin.
 */
public GraphiteGlassSkin() {
	super();

	SubstanceSkin.ColorSchemes schemes = SubstanceSkin.getColorSchemes(
			this.getClass().getClassLoader().getResourceAsStream(
					"org/pushingpixels/substance/api/skin/graphite.colorschemes"));

	SubstanceColorScheme backgroundScheme = schemes.get("Graphite Background");
	this.registerAsDecorationArea(backgroundScheme, DecorationAreaType.PRIMARY_TITLE_PANE,
			DecorationAreaType.SECONDARY_TITLE_PANE, DecorationAreaType.HEADER);

	// add two overlay painters to create a bezel line between
	// menu bar and toolbars
	BottomLineOverlayPainter menuOverlayPainter = new BottomLineOverlayPainter(
			ColorSchemeSingleColorQuery.MID);
	TopLineOverlayPainter toolbarOverlayPainter = new TopLineOverlayPainter(
			(SubstanceColorScheme scheme) -> SubstanceColorUtilities.getAlphaColor(
					scheme.getForegroundColor(), 32));
	this.addOverlayPainter(menuOverlayPainter, DecorationAreaType.HEADER);
	this.addOverlayPainter(toolbarOverlayPainter, DecorationAreaType.TOOLBAR);

	this.fillPainter = new GlassFillPainter();
	this.decorationPainter = new ArcDecorationPainter();
	this.highlightPainter = new GlassHighlightPainter();
}
 
Example 2
@Override
public Color getRepresentativeColor(SubstanceColorScheme borderScheme) {
	for (int i = 0; i < this.fractions.length - 1; i++) {
		float fractionLow = this.fractions[i];
		float fractionHigh = this.fractions[i + 1];
		if (fractionLow == 0.5f) {
			return this.colorQueries[i].query(borderScheme);
		}
		if (fractionHigh == 0.5f) {
			return this.colorQueries[i + 1].query(borderScheme);
		}
		if ((fractionLow < 0.5f) || (fractionHigh > 0.5f)) {
			continue;
		}
		// current range contains 0.5f
		Color colorLow = this.colorQueries[i].query(borderScheme);
		Color colorHigh = this.colorQueries[i + 1].query(borderScheme);
		float colorLowLikeness = (0.5f - fractionLow) / (fractionHigh - fractionLow);
		return SubstanceColorUtilities.getInterpolatedColor(colorLow, colorHigh,
				colorLowLikeness);
	}
	throw new IllegalStateException("Could not find representative color");
}
 
Example 3
@Override
public void paintOverlay(Graphics2D graphics, Component comp,
        DecorationAreaType decorationAreaType, int width, int height,
        SubstanceSkin skin) {
    Color shadowColor = SubstanceColorUtilities.deriveByBrightness(
            SubstanceColorUtilities.getBackgroundFillColor(comp), -0.4f);

    // need to handle components "embedded" in other components
    Component topMostWithSameDecorationAreaType = SubstanceCoreUtilities
            .getTopMostParentWithDecorationAreaType(comp, decorationAreaType);
    Point inTopMost = SwingUtilities.convertPoint(comp, new Point(0, 0),
            topMostWithSameDecorationAreaType);
    int dy = inTopMost.y;

    Graphics2D g2d = (Graphics2D) graphics.create();
    g2d.translate(0, -dy);
    g2d.setPaint(new GradientPaint(
            0, 0, SubstanceColorUtilities.getAlphaColor(shadowColor, this.startAlpha),
            0, 4, SubstanceColorUtilities.getAlphaColor(shadowColor, 16)));
    g2d.fillRect(0, 0, comp.getWidth(), 4);
    g2d.dispose();
}
 
Example 4
/**
 * Fills the relevant part with the gradient fill.
 *
 * @param graphics Graphics.
 * @param scheme   Color scheme to use.
 * @param offsetY  Vertical offset.
 * @param x        X coordinate of the fill area.
 * @param y        Y coordinate of the fill area.
 * @param width    Fill area width.
 * @param height   Fill area height.
 */
protected void fill(Graphics2D graphics, SubstanceColorScheme scheme,
        int offsetY, int x, int y, int width, int height) {
    // 0 - flex : light -> medium
    // flex - : medium fill

    Color startColor = scheme.getLightColor();
    Color endColor = SubstanceColorUtilities.getInterpolatedColor(startColor,
            scheme.getMidColor(), 0.4f);

    int gradientHeight = Math.max(FLEX_POINT, height + offsetY);
    Paint paint = (gradientHeight == FLEX_POINT) ?
            new GradientPaint(0, y - offsetY, startColor, 0, y + gradientHeight - offsetY,
                    endColor) :
            new LinearGradientPaint(
                    0, y - offsetY, 0, y + height - offsetY,
                    new float[] { 0.0f, (float) FLEX_POINT / (float) gradientHeight, 1.0f },
                    new Color[] { startColor, endColor, endColor },
                    MultipleGradientPaint.CycleMethod.NO_CYCLE);

    graphics.setPaint(paint);
    graphics.fillRect(x, y, width, height);
}
 
Example 5
@Override
public void paintDecorationArea(Graphics2D graphics, Component comp, DecorationAreaType
        decorationAreaType, Shape contour, SubstanceColorScheme colorScheme) {
    Point offset = SubstanceCoreUtilities.getOffsetInRootPaneCoords(comp);

    Color startColor = colorScheme.getLightColor();
    Color endColor = SubstanceColorUtilities.getInterpolatedColor(startColor,
            colorScheme.getMidColor(), 0.4f);

    int gradientHeight = Math.max(FLEX_POINT, comp.getHeight() + offset.y);
    Paint paint = (gradientHeight == FLEX_POINT) ?
            new GradientPaint(0, -offset.y, startColor, 0, gradientHeight - offset.y,
                    endColor) :
            new LinearGradientPaint(
                    0, -offset.y, 0, comp.getHeight() - offset.y,
                    new float[] { 0.0f, (float) FLEX_POINT / (float) gradientHeight, 1.0f },
                    new Color[] { startColor, endColor, endColor },
                    MultipleGradientPaint.CycleMethod.NO_CYCLE);

    graphics.setPaint(paint);
    graphics.fill(contour);
}
 
Example 6
@Override
public String toString() {
	return this.getDisplayName() + " {\n    kind="
			+ (this.isDark() ? "Dark" : "Light") + "\n    colorUltraLight="
			+ SubstanceColorUtilities.encode(this.getUltraLightColor())
			+ "\n    colorExtraLight="
			+ SubstanceColorUtilities.encode(this.getExtraLightColor())
			+ "\n    colorLight="
			+ SubstanceColorUtilities.encode(this.getLightColor())
			+ "\n    colorMid="
			+ SubstanceColorUtilities.encode(this.getMidColor())
			+ "\n    colorDark="
			+ SubstanceColorUtilities.encode(this.getDarkColor())
			+ "\n    colorUltraDark="
			+ SubstanceColorUtilities.encode(this.getUltraDarkColor())
			+ "\n    colorForeground="
			+ SubstanceColorUtilities.encode(this.getForegroundColor())
			+ "\n}";
}
 
Example 7
@Override
protected void installDefaults() {
    super.installDefaults();

    // support for per-window skins
    SwingUtilities.invokeLater(() -> {
        if (!SubstanceCoreUtilities.isCurrentLookAndFeel())
            return;
        if (textArea == null)
            return;
        Color foregr = textArea.getForeground();
        if ((foregr == null) || (foregr instanceof UIResource)) {
            textArea.setForeground(SubstanceColorUtilities
                    .getForegroundColor(SubstanceCortex.ComponentScope.getCurrentSkin(textArea)
                            .getEnabledColorScheme(ComponentOrParentChainScope
                                    .getDecorationType(textArea))));
        }
    });
    for (SubstanceWidget lafWidget : this.lafWidgets) {
        lafWidget.installDefaults();
    }
}
 
Example 8
@Override
protected void installDefaults() {
    super.installDefaults();

    editorPane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, true);

    // support for per-window skins
    SwingUtilities.invokeLater(() -> {
        if (editorPane == null) {
            return;
        }
        Color foregr = editorPane.getForeground();
        if ((foregr == null) || (foregr instanceof UIResource)) {
            editorPane.setForeground(SubstanceColorUtilities.getForegroundColor(
                    SubstanceCortex.ComponentScope.getCurrentSkin(editorPane)
                            .getEnabledColorScheme(ComponentOrParentChainScope
                                    .getDecorationType(editorPane))));
        }
    });
    for (SubstanceWidget lafWidget : this.lafWidgets) {
        lafWidget.installDefaults();
    }
}
 
Example 9
@Override
protected void installDefaults() {
    super.installDefaults();

    // support for per-window skins
    SwingUtilities.invokeLater(() -> {
        if (textPane == null)
            return;
        Color foregr = textPane.getForeground();
        if ((foregr == null) || (foregr instanceof UIResource)) {
            textPane.setForeground(SubstanceColorUtilities
                    .getForegroundColor(SubstanceCortex.ComponentScope.getCurrentSkin(textPane)
                            .getEnabledColorScheme(ComponentOrParentChainScope
                                    .getDecorationType(textPane))));
        }
    });
    for (SubstanceWidget lafWidget : this.lafWidgets) {
        lafWidget.installDefaults();
    }
}
 
Example 10
/**
 * Creates a new hue-shifted color scheme.
 * 
 * @param origScheme
 *            The original color scheme.
 * @param hueShiftFactor
 *            Shift factor. Should be in -1.0-1.0 range.
 */
public HueShiftColorScheme(SubstanceColorScheme origScheme,
		double hueShiftFactor) {
	super("Hue-shift " + origScheme.getDisplayName() + " "
			+ (int) (100 * hueShiftFactor) + "%", origScheme.isDark());
	this.hueShiftFactor = hueShiftFactor;
	this.origScheme = origScheme;
	this.foregroundColor = SubstanceColorUtilities.getHueShiftedColor(
			origScheme.getForegroundColor(), this.hueShiftFactor / 2.0);
	this.mainUltraDarkColor = SubstanceColorUtilities.getHueShiftedColor(
			origScheme.getUltraDarkColor(), this.hueShiftFactor);
	this.mainDarkColor = SubstanceColorUtilities.getHueShiftedColor(
			origScheme.getDarkColor(), this.hueShiftFactor);
	this.mainMidColor = SubstanceColorUtilities.getHueShiftedColor(
			origScheme.getMidColor(), this.hueShiftFactor);
	this.mainLightColor = SubstanceColorUtilities.getHueShiftedColor(
			origScheme.getLightColor(), this.hueShiftFactor);
	this.mainExtraLightColor = SubstanceColorUtilities.getHueShiftedColor(
			origScheme.getExtraLightColor(), this.hueShiftFactor);
	this.mainUltraLightColor = SubstanceColorUtilities.getHueShiftedColor(
			origScheme.getUltraLightColor(), this.hueShiftFactor);
}
 
Example 11
/**
 * Creates a new inverted scheme.
 * 
 * @param origScheme
 *            The original color scheme.
 */
public NegatedColorScheme(SubstanceColorScheme origScheme) {
	super("Negated " + origScheme.getDisplayName(), !origScheme.isDark());
	this.origScheme = origScheme;

	this.foregroundColor = SubstanceColorUtilities.invertColor(origScheme.getForegroundColor());

	this.mainUltraDarkColor = SubstanceColorUtilities
			.invertColor(origScheme.getUltraDarkColor());
	this.mainDarkColor = SubstanceColorUtilities.invertColor(origScheme.getDarkColor());
	this.mainMidColor = SubstanceColorUtilities.invertColor(origScheme.getMidColor());
	this.mainLightColor = SubstanceColorUtilities.invertColor(origScheme.getLightColor());
	this.mainExtraLightColor = SubstanceColorUtilities
			.invertColor(origScheme.getExtraLightColor());
	this.mainUltraLightColor = SubstanceColorUtilities
			.invertColor(origScheme.getUltraLightColor());
	this.isDark = !origScheme.isDark();
}
 
Example 12
/**
 * Creates a new saturated color scheme.
 * 
 * @param origScheme
 *            The original color scheme.
 * @param saturationFactor
 *            Saturation factor. Should be in -1.0..1.0 range.
 */
public SaturatedColorScheme(SubstanceColorScheme origScheme,
		double saturationFactor) {
	super("Saturated (" + (int) (100 * saturationFactor) + "%) "
			+ origScheme.getDisplayName(), origScheme.isDark());
	this.saturationFactor = saturationFactor;
	this.origScheme = origScheme;
	this.foregroundColor = origScheme.getForegroundColor();
	this.mainUltraDarkColor = SubstanceColorUtilities.getSaturatedColor(
			origScheme.getUltraDarkColor(), saturationFactor);
	this.mainDarkColor = SubstanceColorUtilities.getSaturatedColor(
			origScheme.getDarkColor(), saturationFactor);
	this.mainMidColor = SubstanceColorUtilities.getSaturatedColor(
			origScheme.getMidColor(), saturationFactor);
	this.mainLightColor = SubstanceColorUtilities.getSaturatedColor(
			origScheme.getLightColor(), saturationFactor);
	this.mainExtraLightColor = SubstanceColorUtilities.getSaturatedColor(
			origScheme.getExtraLightColor(), saturationFactor);
	this.mainUltraLightColor = SubstanceColorUtilities.getSaturatedColor(
			origScheme.getUltraLightColor(), saturationFactor);
}
 
Example 13
@Override
protected void paintGroupBackground(Graphics g, int groupIndex, int x,
        int y, int width, int height) {
    Color background = SubstanceColorUtilities.getBackgroundFillColor(this.buttonPanel);
    if (groupIndex % 2 == 1) {
        background = SubstanceColorUtilities.getDarkerColor(background, 0.06);
    }

    BackgroundPaintingUtils.fillAndWatermark(g, this.buttonPanel,
            background, new Rectangle(x, y, width, height));
}
 
Example 14
@Override
public void paintOverlay(Graphics2D graphics, Component comp,
		DecorationAreaType decorationAreaType, int width, int height,
		SubstanceSkin skin) {
	Color shadowColor = SubstanceColorUtilities.deriveByBrightness(
			SubstanceColorUtilities.getBackgroundFillColor(comp), -0.4f);

	Component topMostWithSameDecorationAreaType = SubstanceCoreUtilities
			.getTopMostParentWithDecorationAreaType(comp,
					decorationAreaType);
	int topHeight = topMostWithSameDecorationAreaType.getHeight();

	Point inTopMost = SwingUtilities.convertPoint(comp, new Point(0, 0),
			topMostWithSameDecorationAreaType);
	int dy = inTopMost.y;

	Graphics2D fillGraphics = (Graphics2D) graphics.create();
	fillGraphics.translate(0, -dy);

	int shadowHeight = 4;
	GradientPaint fillPaint = new GradientPaint(0, topHeight - shadowHeight, 
			SubstanceColorUtilities.getAlphaColor(shadowColor, 0), 0, topHeight,
			SubstanceColorUtilities.getAlphaColor(shadowColor, this.endAlpha));
	fillGraphics.setPaint(fillPaint);
	fillGraphics.fillRect(0, topHeight - shadowHeight, width, shadowHeight);
	fillGraphics.dispose();
}
 
Example 15
Source Project: radiance   Source File: GlowingIcon.java    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
	if (this.delegate == null)
		return;
	float fadePos = this.iconGlowTracker.getIconGlowPosition();
	// System.out.println(fadePos);
	Icon toPaint = this.iconMap.get(fadePos);
	if (toPaint == null) {
		int width = this.getIconWidth();
		int height = this.getIconHeight();
		BufferedImage image = SubstanceCoreUtilities.getBlankImage(width,
				height);
		Graphics2D graphics = (Graphics2D) image.getGraphics();
		//graphics.scale(1.0f / scale, 1.0f / scale);
		this.delegate.paintIcon(c, graphics, 0, 0);
		int pixelWidth = image.getWidth();
		int pixelHeight = image.getHeight();
		for (int i = 0; i < pixelWidth; i++) {
			for (int j = 0; j < pixelHeight; j++) {
				int rgba = image.getRGB(i, j);
				int transp = (rgba >>> 24) & 0xFF;
				double coef = Math.sin(2.0 * Math.PI * fadePos / 2.0) / glowDampeningFactor;
				Color newColor = (coef >= 0.0) ? SubstanceColorUtilities
						.getLighterColor(new Color(rgba), coef)
						: SubstanceColorUtilities.getDarkerColor(new Color(
								rgba), -coef);
				image.setRGB(i, j, (transp << 24)
						| (newColor.getRed() << 16)
						| (newColor.getGreen() << 8) | newColor.getBlue());
			}
		}
		toPaint = new ImageWrapperIcon(image);
		this.iconMap.put(fadePos, toPaint);
	}
	Graphics2D g2d = (Graphics2D) g.create();
	g2d.translate(x, y);
	toPaint.paintIcon(c, g, 0, 0);
	g2d.dispose();
}
 
Example 16
/**
 * Returns the highlight color for the specified component.
 * 
 * @param c
 *            Component.
 * @return Matching highlight color.
 */
public Color getHighlightColor(Component c) {
	SubstanceColorScheme colorScheme = SubstanceColorSchemeUtilities
			.getColorScheme(c, ColorSchemeAssociationKind.SEPARATOR,
					ComponentState.ENABLED);
	boolean isDark = colorScheme.isDark();
	Color foreDark = isDark ? colorScheme.getExtraLightColor()
			: SubstanceColorUtilities.getInterpolatedColor(colorScheme
					.getMidColor(), colorScheme.getDarkColor(), 0.4);

	return SubstanceColorUtilities.getAlphaColor(foreDark, 196);
}
 
Example 17
/**
 * Returns the shadow color for the specified component.
 * 
 * @param c
 *            Component.
 * @return Matching shadow color.
 */
public Color getShadowColor(Component c) {
	SubstanceColorScheme colorScheme = SubstanceColorSchemeUtilities
			.getColorScheme(c, ColorSchemeAssociationKind.SEPARATOR,
					ComponentState.ENABLED);
	Color back = colorScheme.isDark() ? colorScheme.getDarkColor()
			: colorScheme.getUltraLightColor();
	return SubstanceColorUtilities.getAlphaColor(back, 196);
}
 
Example 18
private void grayScaleColor(int[] pixels) {
	for (int i = 0; i < pixels.length; i++) {
		int argb = pixels[i];
		int brightness = SubstanceColorUtilities.getColorBrightness(argb);
		pixels[i] = (argb & 0xFF000000) | brightness << 16 | brightness << 8 | brightness;
	}
}
 
Example 19
private void mixColor(int[] pixels) {
    for (int i = 0; i < pixels.length; i++) {
        int argb = pixels[i];

        int brightness = SubstanceColorUtilities.getColorBrightness(argb);

        int r = (argb >>> 16) & 0xFF;
        int g = (argb >>> 8) & 0xFF;
        int b = (argb >>> 0) & 0xFF;

        float[] hsb = Color.RGBtoHSB(r, g, b, null);
        int pixelColor = interpolated[brightness * MAPSTEPS / 256];

        int ri = (pixelColor >>> 16) & 0xFF;
        int gi = (pixelColor >>> 8) & 0xFF;
        int bi = (pixelColor >>> 0) & 0xFF;
        float[] hsbi = Color.RGBtoHSB(ri, gi, bi, null);

        hsb[0] = hsbi[0];
        hsb[1] = hsbi[1];
        if (this.originalBrightnessFactor >= 0.0f) {
            hsb[2] = this.originalBrightnessFactor * hsb[2]
                    + (1.0f - this.originalBrightnessFactor) * hsbi[2];
        } else {
            hsb[2] = hsb[2] * hsbi[2] * (1.0f + this.originalBrightnessFactor);
        }

        int result = Color.HSBtoRGB(hsb[0], hsb[1], hsb[2]);

        pixels[i] = (argb & 0xFF000000) | ((result >> 16) & 0xFF) << 16
                | ((result >> 8) & 0xFF) << 8 | (result & 0xFF);
    }
}
 
Example 20
@Override
protected void installDefaults(JComponent c) {
	super.installDefaults(c);
	// support for per-window skins
	Color backgr = c.getBackground();
	if ((backgr == null) || (backgr instanceof UIResource)) {
		Color backgroundFillColor = SubstanceColorUtilities.getBackgroundFillColor(c);
		if (backgroundFillColor != null) {
			c.setBackground(new ColorUIResource(backgroundFillColor));
		}
	}
}
 
Example 21
@Override
protected void installDefaults(JPanel p) {
	super.installDefaults(p);
	// support for per-window skins
	Color backgr = p.getBackground();
	if ((backgr == null) || (backgr instanceof UIResource)) {
		Color backgroundFillColor = SubstanceColorUtilities.getBackgroundFillColor(p);
		// fix for issue 436 - logic in getBackground() of
		// custom panels can result in null value
		if (backgroundFillColor != null) {
			p.setBackground(new ColorUIResource(backgroundFillColor));
		}
	}
}
 
Example 22
Source Project: radiance   Source File: SwatchPanel.java    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public void paintComponent(Graphics g) {
    Dimension preferredSize = getSwatchesSize();
    int xoffset = (getWidth() - preferredSize.width) / 2;
    int yoffset = 0;// (getHeight() - preferredSize.height) / 2;

    Graphics2D g2d = (Graphics2D) g.create();

    for (int row = 0; row < numSwatches.height; row++) {
        for (int column = 0; column < numSwatches.width; column++) {
            Color cellColor = getColorForCell(column, row);
            g2d.setColor(cellColor);
            //int x = (numSwatches.width - column - 1) * (swatchSize.width + gap.width);
            int x = xoffset + column * (swatchSize.width + gap.width) + 1;
            int y = yoffset + row * (swatchSize.height + gap.height) + 1;
            g2d.fillRect(x, y, swatchSize.width + 1, swatchSize.height + 1);

            float borderStrokeWidth = SubstanceSizeUtils.getBorderStrokeWidth();
            g2d.setStroke(new BasicStroke(borderStrokeWidth));

            g2d.setColor(SubstanceColorUtilities.deriveByBrightness(cellColor, -0.5f));
            g2d.draw(new Line2D.Float(x - borderStrokeWidth, y - borderStrokeWidth,
                    x + swatchSize.width, y - borderStrokeWidth));
            //x - 1, y - 1, swatchSize.width+1, 1);
            g2d.draw(new Line2D.Float(x - borderStrokeWidth, y,
                    x - borderStrokeWidth, y + swatchSize.height));
            //g2d.fillRect(x - 1, y, 1, swatchSize.height);
        }
    }

    g2d.dispose();
}
 
Example 23
/**
 * Invoked when the mouse exits a component.
 */
public void mouseMoved(MouseEvent e) {
	GeneralPath oldPath = rolloverPath;
	rolloverPath = null;
	if (e.getSource() == imagePicker) {
		Point pt = e.getPoint();
		if (paths != null) {
			int numPaths = paths.length;
			for (int i = 0; i < numPaths; i++) {
				if (paths[i].contains(pt.x, pt.y)) {
					rolloverPath = paths[i];
					ModelColor[][] baseColors = ModelColor.getBaseColors();
					int ring = i / ModelColor.NUM_SEGMENTS;
					ModelColor modelColor = baseColors[i
							% ModelColor.NUM_SEGMENTS][ring];
					if (adjustRollover) {
						modelColor = new ModelColor(modelColor.H,
								saturationMultipler * modelColor.S,
								brightnessMultipler * modelColor.V);
					}

					rolloverColor = new Color(modelColor.getRed(),
							modelColor.getGreen(), modelColor.getBlue());
					if (ring < 4) {
						rolloverColor = SubstanceColorUtilities.deriveByBrightness(
								rolloverColor, -0.5f);
					} else {
						rolloverColor = SubstanceColorUtilities.deriveByBrightness(
								rolloverColor, 0.8f);
					}
					break;
				}
			}
		}
	}

	if (rolloverPath != oldPath)
		repaint();
}
 
Example 24
/**
 * Creates a new inverted scheme.
 * 
 * @param origScheme
 *            The original color scheme.
 */
public InvertedColorScheme(SubstanceColorScheme origScheme) {
	super("Inverted " + origScheme.getDisplayName(), !origScheme.isDark());
	this.origScheme = origScheme;
	this.foregroundColor = SubstanceColorUtilities.invertColor(origScheme.getForegroundColor());
	this.mainUltraDarkColor = SubstanceColorUtilities
			.invertColor(origScheme.getUltraLightColor());
	this.mainDarkColor = SubstanceColorUtilities.invertColor(origScheme.getExtraLightColor());
	this.mainMidColor = SubstanceColorUtilities.invertColor(origScheme.getLightColor());
	this.mainLightColor = SubstanceColorUtilities.invertColor(origScheme.getMidColor());
	this.mainExtraLightColor = SubstanceColorUtilities.invertColor(origScheme.getDarkColor());
	this.mainUltraLightColor = SubstanceColorUtilities
			.invertColor(origScheme.getUltraDarkColor());
	this.isDark = !origScheme.isDark();
}
 
Example 25
/**
 * Creates a new blended color scheme.
 * 
 * @param firstScheme
 *            The first original color scheme.
 * @param secondScheme
 *            The second original color scheme.
 * @param firstSchemeLikeness
 *            Likeness to the first scheme. Values close to 0.0 will create
 *            scheme that closely matches the second original scheme. Values
 *            close to 1.0 will create scheme that closely matches the
 *            second original scheme.
 */
public BlendBiColorScheme(SubstanceColorScheme firstScheme,
		SubstanceColorScheme secondScheme, double firstSchemeLikeness) {
	super("Blended " + firstScheme.getDisplayName() + " & "
			+ secondScheme.getDisplayName() + " " + firstSchemeLikeness,
			firstScheme.isDark());
	this.firstScheme = firstScheme;
	this.secondScheme = secondScheme;
	this.firstSchemeLikeness = firstSchemeLikeness;
	this.foregroundColor = new Color(SubstanceColorUtilities
			.getInterpolatedRGB(firstScheme.getForegroundColor(),
					secondScheme.getForegroundColor(), firstSchemeLikeness));
	this.mainUltraDarkColor = new Color(SubstanceColorUtilities
			.getInterpolatedRGB(firstScheme.getUltraDarkColor(),
					secondScheme.getUltraDarkColor(), firstSchemeLikeness));
	this.mainDarkColor = new Color(SubstanceColorUtilities
			.getInterpolatedRGB(firstScheme.getDarkColor(), secondScheme
					.getDarkColor(), firstSchemeLikeness));
	this.mainMidColor = new Color(SubstanceColorUtilities
			.getInterpolatedRGB(firstScheme.getMidColor(), secondScheme
					.getMidColor(), firstSchemeLikeness));
	this.mainLightColor = new Color(SubstanceColorUtilities
			.getInterpolatedRGB(firstScheme.getLightColor(), secondScheme
					.getLightColor(), firstSchemeLikeness));
	this.mainExtraLightColor = new Color(SubstanceColorUtilities
			.getInterpolatedRGB(firstScheme.getExtraLightColor(),
					secondScheme.getExtraLightColor(), firstSchemeLikeness));
	this.mainUltraLightColor = new Color(SubstanceColorUtilities
			.getInterpolatedRGB(firstScheme.getUltraLightColor(),
					secondScheme.getUltraLightColor(), firstSchemeLikeness));
}
 
Example 26
@Override
public Color getTopBorderColor(SubstanceColorScheme borderScheme) {
	return SubstanceColorUtilities.getInterpolatedColor(super.getTopBorderColor(borderScheme),
			super.getMidBorderColor(borderScheme), 0.0f);
}
 
Example 27
@Override
public Color getTopBorderColor(SubstanceColorScheme borderScheme) {
	return SubstanceColorUtilities.getInterpolatedColor(super.getTopBorderColor(borderScheme),
			super.getMidBorderColor(borderScheme), 0.0f);
}
 
Example 28
@Override
public Color getTopFillColor(SubstanceColorScheme fillScheme) {
	return SubstanceColorUtilities.getInterpolatedColor(super.getBottomFillColor(fillScheme),
			super.getMidFillColorTop(fillScheme), 0.6f);
}
 
Example 29
@Override
public Color getMidFillColorTop(SubstanceColorScheme fillScheme) {
	return SubstanceColorUtilities.getInterpolatedColor(this.getTopFillColor(fillScheme),
			super.getMidFillColorTop(fillScheme), 0.8f);
}
 
Example 30
@Override
public Color getBottomFillColor(SubstanceColorScheme fillScheme) {
	return SubstanceColorUtilities.getInterpolatedColor(this.getMidFillColorBottom(fillScheme),
			super.getBottomFillColor(fillScheme), 0.7f);
}