public CopyMutableColorScheme(String name, SubstanceColorScheme copy) { super(name, copy.isDark()); foregroundColor = copy.getForegroundColor(); ultraLightColor = copy.getUltraLightColor(); extraLightColor = copy.getExtraLightColor(); lightColor = copy.getLightColor(); midColor = copy.getMidColor(); darkColor = copy.getDarkColor(); ultraDarkColor = copy.getUltraDarkColor(); }
@Override public SubstanceColorScheme transform( SubstanceColorScheme scheme) { return scheme.shiftBackground( scheme.getUltraLightColor(), 0.8).tint( 0.6).saturate(0.2); } }));
@Override public String toString() { return this.scheme.getDisplayName(); }
public static Color getSeparatorLightColor(SubstanceColorScheme scheme) { return scheme.isDark() ? scheme.getLightColor() : SubstanceColorUtilities.getInterpolatedColor(scheme .getLightColor(), scheme.getDarkColor(), 0.8); }
.getDisabledColorScheme(DecorationAreaType.NONE); Color controlText = new ColorUIResource(mainActiveScheme .getLightColor()); Color foregroundColor = SubstanceColorUtilities .getForegroundColor(mainEnabledScheme); Color backgroundActiveColor = new ColorUIResource(mainActiveScheme .getBackgroundFillColor()); Color backgroundDefaultColor = new ColorUIResource(mainEnabledScheme .getBackgroundFillColor()); Color textBackgroundColor = new ColorUIResource(mainActiveScheme .getTextBackgroundFillColor()); Color lineColor = new ColorUIResource(mainActiveScheme.getLineColor()); .getLineColor()); textHighlightColorScheme.getSelectionBackgroundColor()); Color selectionTextForegroundColor = new ColorUIResource( textHighlightColorScheme.getSelectionForegroundColor()); textHighlightColorScheme.getForegroundColor()); Color selectionCellBackgroundColor = new ColorUIResource( textHighlightColorScheme.getBackgroundFillColor()); skin.isRegisteredAsDecorationArea(DecorationAreaType.HEADER) ? new ColorUIResource( skin.getActiveColorScheme(DecorationAreaType.HEADER) .getMidColor()) : SubstanceColorUtilities.getDefaultBackgroundColor( false, skin, false),
/** * Creates a new inverted scheme. * * @param origScheme * The original color scheme. */ public NegatedColorScheme(SubstanceColorScheme origScheme) { super("Negated " + origScheme.getDisplayName(), getResolver(origScheme).invert()); 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()); }
.getForegroundColor(mainEnabledScheme); Color backgroundColor = new ColorUIResource(mainActiveScheme .getBackgroundFillColor()); Color disabledForegroundColor = SubstanceColorUtilities .getForegroundColor(mainDisabledScheme); highlightColorScheme.getSelectionBackgroundColor()); highlightColorScheme.getSelectionForegroundColor()); mainActiveScheme.isDark() ? mainActiveScheme .getUltraLightColor() : mainActiveScheme .getLightColor()), mainActiveScheme.isDark() ? mainActiveScheme .getLightColor() : mainActiveScheme .getMidColor()),
public static Color getSeparatorDarkColor(SubstanceColorScheme scheme) { return scheme.isDark() ? scheme.getExtraLightColor() : SubstanceColorUtilities.getInterpolatedColor(scheme .getMidColor(), scheme.getDarkColor(), 0.4); }
/** * Returns the color of the bottom portion of border in control backgrounds. * * @param scheme * The color scheme. * @return The color of the bottom portion of border in control backgrounds. */ public static Color getBottomBorderColor(SubstanceColorScheme scheme) { return SubstanceColorUtilities.getInterpolatedColor(scheme .getDarkColor(), scheme.getMidColor(), 0.5); }
protected void paintBackground(final Graphics2D g2) { g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setPaint(GraphicsHelper.buildVerticalGradientPaint(ContentPanel.class.getName(), this.getHeight(), this.colorScheme.getUltraLightColor(), this.colorScheme.getLightColor())); g2.fillRect(0, 0, this.getWidth(), this.getHeight()); }
@Override public Color query(SubstanceColorScheme scheme) { return scheme.getForegroundColor(); } };
private void paintCellBackground(final int columnIndex, final Graphics2D graphics, final Rectangle rectangleToPaint) { final LocalDate date = super.parent.getColumnDefinitionAt(columnIndex); if (date.getDayOfWeek() == DateTimeConstants.SATURDAY || date.getDayOfWeek() == DateTimeConstants.SUNDAY) { graphics.setPaint(GraphicsHelper.buildVerticalGradientPaint(TimelineFooterPanel.class.getName() + "_day_weekEnd", super.configurationContext.getCellHeight(), super.colorScheme.getLightColor(), super.colorScheme.getMidColor())); } else { graphics.setPaint(GraphicsHelper.buildVerticalGradientPaint(TimelineFooterPanel.class.getName() + "_day_normal", super.configurationContext.getCellHeight(), super.colorScheme.getUltraLightColor(), super.colorScheme.getLightColor())); } graphics.fillRect(rectangleToPaint.x, rectangleToPaint.y, rectangleToPaint.width, rectangleToPaint.height); }
@Override public SubstanceColorScheme transform( SubstanceColorScheme scheme) { return scheme.tint(0.25f); } }));
/** * Returns the default background color for the components of the specified * class. * * @param toTreatAsTextComponent * if the component is to be colored as a text component. * @param skin * Skin. * @param isDisabled * Indication whether the result should be for disabled * components. * @return The default background color for the components of the specified * class. */ public static ColorUIResource getDefaultBackgroundColor( boolean toTreatAsTextComponent, SubstanceSkin skin, boolean isDisabled) { if (toTreatAsTextComponent || isDisabled) return new ColorUIResource(skin.getEnabledColorScheme( DecorationAreaType.NONE).getTextBackgroundFillColor()); return new ColorUIResource(skin.getEnabledColorScheme( DecorationAreaType.NONE).getBackgroundFillColor()); }
@Override public Color getTextBackgroundFillColor() { return SubstanceColorUtilities.getInterpolatedColor(this.scheme .getMidColor(), this.scheme.getLightColor(), 0.4); } }
@Override public void propertyChange(PropertyChangeEvent e) { super.propertyChange(e); String pName = e.getPropertyName(); if (pName.equals("active")) { SubstanceSkin skin = SubstanceCoreUtilities.getSkin(this.titleBar); SubstanceColorScheme bgColorScheme = skin.getBackgroundColorScheme(DecorationAreaType.HEADER); Color bgFillColor = bgColorScheme.getBackgroundFillColor(); Color fgColor = bgColorScheme.getForegroundColor(); boolean isActive = ((Boolean) e.getNewValue()).booleanValue(); if (isActive) { titleBar.getTitleLabel().setForeground(fgColor); } else { fgColor = SubstanceColorUtilities.getInterpolatedColor(fgColor, bgFillColor, 0.2f); titleBar.getTitleLabel().setForeground(fgColor); } titleBar.getTitleLabel().repaint(); } }
@Override protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) { SubstanceColorScheme scheme = SubstanceColorSchemeUtilities .getColorScheme(this.tabPane, selectedIndex, ColorSchemeAssociationKind.TAB, ComponentState.ENABLED); this.highlight = scheme.isDark() ? SubstanceColorUtilities .getAlphaColor(scheme.getUltraDarkColor(), 100) : scheme .getLightColor(); super.paintContentBorder(g, tabPlacement, selectedIndex); }
@Override public void paintDecorationArea(Graphics2D graphics, Component comp, DecorationAreaType decorationAreaType, int width, int height, SubstanceSkin skin) { graphics .setColor(skin.getBackgroundColorScheme( DecorationAreaType.PRIMARY_TITLE_PANE) .getBackgroundFillColor()); graphics.fillRect(0, 0, width, height); } }
@Override public Color getTextBackgroundFillColor() { return SubstanceColorUtilities.getInterpolatedColor(this.scheme .getUltraLightColor(), this.scheme.getExtraLightColor(), 0.8); } }
/** * Returns the color of the middle portion of border in control backgrounds. * * @param scheme * The color scheme. * @return The color of the middle portion of border in control backgrounds. */ public static Color getMidBorderColor(SubstanceColorScheme scheme) { return scheme.getDarkColor(); }