@Override protected Color convertFocused( Color source, String key ) { if( key.contains( "foreground" ) ) return Colors.diffMirror( source, 1.0 ); if( "title.background.top.active".equals( key )) return Colors.darker( source, 0.3 ); if( "title.background.bottom.active".equals( key )) return Colors.brighter( source, 0.3 ); if( "title.background.top.active.mouse".equals( key )) return Colors.fuller( Colors.darker( source, 0.3 ), 0.3 ); if( "title.background.bottom.active.mouse".equals( key )) return Colors.fuller( Colors.brighter( source, 0.3 ), 0.3 ); return source; }
@Override protected Color convertFocused( Color source, String key ) { if( "stack.tab.border.selected.focused".equals( key )) return source; if( "stack.tab.border.selected.focuslost".equals( key )) return source; if( "stack.tab.top.selected.focused".equals( key )) return Colors.undiffMirror( source, 0.5 ); if( "stack.tab.top.selected.focuslost".equals( key )) return Colors.undiffMirror( source, 0.5 ); if( "stack.tab.bottom.selected.focused".equals( key )) return source; if( "stack.tab.bottom.selected.focuslost".equals( key )) return source; if( "stack.tab.text.selected.focused".equals( key )) return Colors.diffMirror( source, 1.0 ); if( "stack.tab.text.selected.focuslost".equals( key )) return Colors.diffMirror( source, 1.0 ); return null; } }
/** * Creates colors for parts of this border based on some basic color. * @param color the basic color * @param inner whether the inner or the outer rectangle is painted * @param shadow whether the shadow or the highlight part is painted * @return the modified color */ protected Color defaultModify( Color color, boolean inner, boolean shadow ){ if( inner && shadow ){ return Colors.darker( color, 0.2 ); } else if( !inner && shadow ){ return Colors.darker( color, 0.4 ); } else if( inner && !shadow ){ return Colors.brighter( color, 0.2 ); } else { return Colors.brighter( color, 0.4 ); } }
@Override protected Color convertFocused( Color source, String key ) { if( "stack.tab.border.out.focused".equals( key )) return null; if( "stack.tab.border.center.focused".equals( key )) return null; if( "stack.tab.background.top.focused".equals( key )) return Colors.darker( source, 0.3 ); if( "stack.tab.background.bottom.focused".equals( key )) return Colors.brighter( source, 0.3 ); if( "stack.tab.foreground.focused".equals( key )) return Colors.diffMirror( source, 1.0 ); return null; }
setColor( "stack.tab.background.top.mouse", brighter( inactive, factor )); setColor( "stack.tab.background.bottom.mouse", darker( inactive, factor ) ); setColor( "stack.tab.border.mouse", middle( diffMirror( inactive, factorWeak ), diffMirror( active, factorWeak )) ); setColor( "stack.tab.foreground.mouse", diffMirror( inactive, 1.0 )); setColor( "stack.tab.background.top", brighter( inactive, factorWeak )); setColor( "stack.tab.background.bottom", darker( inactive, factorWeak ) ); setColor( "stack.tab.border", diffMirror( inactive, factorWeak )); setColor( "stack.tab.foreground", diffMirror( inactive, 1.0 )); setColor( "stack.tab.background.top.disabled", brighter( disabled, factorWeak )); setColor( "stack.tab.background.bottom.disabled", darker( disabled, factorWeak ) ); setColor( "stack.tab.border.disabled", diffMirror( disabled, factorWeak )); setColor( "stack.tab.foreground.disabled", diffMirror( disabled, 0.8 )); setColor( "stack.tab.background.top.selected.mouse", brighter( inactive, factor )); setColor( "stack.tab.background.bottom.selected.mouse", darker( inactive, factor ) ); setColor( "stack.tab.border.selected.mouse", diffMirror( inactive, factor )); setColor( "stack.tab.foreground.selected.mouse", diffMirror( inactive, 1.0 )); setColor( "stack.tab.background.top.selected", brighter( inactive, factor )); setColor( "stack.tab.background.bottom.selected", darker( inactive, factor ) ); setColor( "stack.tab.border.selected", diffMirror( inactive, factorWeak )); setColor( "stack.tab.foreground.selected", diffMirror( inactive, 1.0 )); setColor( "stack.tab.background.top.focused.mouse", brighter( active, factor )); setColor( "stack.tab.background.bottom.focused.mouse", darker( active, factor )); setColor( "stack.tab.border.focused.mouse", diffMirror( active, factor )); setColor( "stack.tab.foreground.focused.mouse", diffMirror( active, 1.0 ));
/** * Creates a new color scheme * @param active color for active elements * @param inactive color for inactive elements * @param enabled color for enabled buttons * @param selected color for selected buttons * @param disabled color for disabled buttons * @param factorWeak factor for weak color transformation * @param factor factor for color transformation * @param factorStrong factor for strong color transformation */ public SimpleBubbleColorScheme( Color active, Color inactive, Color enabled, Color selected, Color disabled, double factorWeak, double factor, double factorStrong ){ this( active, inactive, enabled, selected, disabled, diffMirror( active, 1.0 ), diffMirror( inactive, 1.0 ), factorWeak, factor, factorStrong ); }
@Override protected Color convert( Color source, String key ){ if( key.contains( "selected" )) return convertSelected( Colors.undiffMirror( source, 0.2 ), key ); if( key.contains( "focused" )) return convertFocused( Colors.diffMirror( source, 0.2 ), key ); if( "stack.tab.background.top.mouse".equals( key )) return Colors.fuller( source, 0.3 ); if( "stack.tab.background.bottom.mouse".equals( key )) return Colors.fuller( Colors.diffMirror( source, 0.3 ), 0.3 ); if( "stack.tab.border.mouse".equals( key )) return Colors.fuller( Colors.diffMirror( source, 0.6 ), 0.3 ); if( "stack.tab.foreground.mouse".equals( key )) return Colors.fuller( Colors.diffMirror( source, 0.9 ), 0.3 ); if( "stack.tab.background.top".equals( key )) return source; if( "stack.tab.background.bottom".equals( key )) return Colors.diffMirror( source, 0.3 ); if( "stack.tab.border".equals( key )) return Colors.diffMirror( source, 0.6 ); if( "stack.tab.foreground".equals( key )) return Colors.diffMirror( source, 0.9 ); return null; }
@Override protected Color convertFocused( Color source, String key ){ if( "stack.tab.background.top.focused.mouse".equals( key )) return Colors.fuller( source, 0.3 ); if( "stack.tab.background.bottom.focused.mouse".equals( key )) return Colors.fuller( Colors.diffMirror( source, 0.3 ), 0.3 ); if( "stack.tab.border.focused.mouse".equals( key )) return Colors.fuller( Colors.diffMirror( source, 0.6 ), 0.3 ); if( "stack.tab.foreground.focused.mouse".equals( key )) return Colors.fuller( Colors.diffMirror( source, 0.9 ), 0.3 ); if( "stack.tab.background.top.focused".equals( key )) return source; if( "stack.tab.background.bottom.focused".equals( key )) return Colors.diffMirror( source, 0.3 ); if( "stack.tab.border.focused".equals( key )) return Colors.diffMirror( source, 0.6 ); if( "stack.tab.foreground.focused".equals( key )) return Colors.diffMirror( source, 0.9 ); return null; }
/** * Decreases the brightness of a color. * @param c the color which will be made darker * @param value how much darker the color should be, 1 means black, 0 * means <code>c</code> is returned * @return a color which is darker than <code>c</code> */ public static Color darker ( Color c, double value ){ if ( c == null ) return null; if( value < 0 ){ return brighter( c, -value ); } if ( value > 1 ) value = 1; value = 1 - value; return new Color ( (int)(c.getRed() * value), (int)(c.getGreen() * value), (int)(c.getBlue() * value) ); }
/** * Increases the brightness of a color. * @param c the color which will be made brighter * @param value how much brighter the color should be, 1 means * white, 0 means <code>c</code> is returned * @return a color which is brighter than <code>c</code> */ public static Color brighter( Color c, double value ){ if ( c == null ) return null; if( value < 0 ){ return darker( c, -value ); } int dr, dg, db; if ( value > 1 ){ value = 1; } dr = 255 - c.getRed(); dg = 255 - c.getGreen(); db = 255 - c.getBlue(); Color back = new Color ( c.getRed() + (int)(dr * value ), c.getGreen() + (int)(dg * value ), c.getBlue() + (int)(db * value ) ); return back; }
@Override protected Color convertFocused( Color source, String key ) { if( "stack.tab.border.out.focused".equals( key )) return null; if( "stack.tab.border.center.focused".equals( key )) return null; if( "stack.tab.background.top.focused".equals( key )) return Colors.darker( source, 0.3 ); if( "stack.tab.background.bottom.focused".equals( key )) return Colors.brighter( source, 0.3 ); if( "stack.tab.foreground.focused".equals( key )) return Colors.diffMirror( source, 1.0 ); return null; }
/** * Creates colors for parts of this border based on some basic color. * @param color the basic color * @param inner whether the inner or the outer rectangle is painted * @param shadow whether the shadow or the highlight part is painted * @return the modified color */ protected Color defaultModify( Color color, boolean inner, boolean shadow ){ if( inner && shadow ){ return Colors.darker( color, 0.2 ); } else if( !inner && shadow ){ return Colors.darker( color, 0.4 ); } else if( inner && !shadow ){ return Colors.brighter( color, 0.2 ); } else { return Colors.brighter( color, 0.4 ); } }
setColor( "stack.tab.background.top.mouse", brighter( inactive, factor )); setColor( "stack.tab.background.bottom.mouse", darker( inactive, factor ) ); setColor( "stack.tab.border.mouse", middle( diffMirror( inactive, factorWeak ), diffMirror( active, factorWeak )) ); setColor( "stack.tab.foreground.mouse", diffMirror( inactive, 1.0 )); setColor( "stack.tab.background.top", brighter( inactive, factorWeak )); setColor( "stack.tab.background.bottom", darker( inactive, factorWeak ) ); setColor( "stack.tab.border", diffMirror( inactive, factorWeak )); setColor( "stack.tab.foreground", diffMirror( inactive, 1.0 )); setColor( "stack.tab.background.top.disabled", brighter( disabled, factorWeak )); setColor( "stack.tab.background.bottom.disabled", darker( disabled, factorWeak ) ); setColor( "stack.tab.border.disabled", diffMirror( disabled, factorWeak )); setColor( "stack.tab.foreground.disabled", diffMirror( disabled, 0.8 )); setColor( "stack.tab.background.top.selected.mouse", brighter( inactive, factor )); setColor( "stack.tab.background.bottom.selected.mouse", darker( inactive, factor ) ); setColor( "stack.tab.border.selected.mouse", diffMirror( inactive, factor )); setColor( "stack.tab.foreground.selected.mouse", diffMirror( inactive, 1.0 )); setColor( "stack.tab.background.top.selected", brighter( inactive, factor )); setColor( "stack.tab.background.bottom.selected", darker( inactive, factor ) ); setColor( "stack.tab.border.selected", diffMirror( inactive, factorWeak )); setColor( "stack.tab.foreground.selected", diffMirror( inactive, 1.0 )); setColor( "stack.tab.background.top.focused.mouse", brighter( active, factor )); setColor( "stack.tab.background.bottom.focused.mouse", darker( active, factor )); setColor( "stack.tab.border.focused.mouse", diffMirror( active, factor )); setColor( "stack.tab.foreground.focused.mouse", diffMirror( active, 1.0 ));
/** * Creates a new color scheme * @param active color for active elements * @param inactive color for inactive elements * @param enabled color for enabled buttons * @param selected color for selected buttons * @param disabled color for disabled buttons * @param factorWeak factor for weak color transformation * @param factor factor for color transformation * @param factorStrong factor for strong color transformation */ public SimpleBubbleColorScheme( Color active, Color inactive, Color enabled, Color selected, Color disabled, double factorWeak, double factor, double factorStrong ){ this( active, inactive, enabled, selected, disabled, diffMirror( active, 1.0 ), diffMirror( inactive, 1.0 ), factorWeak, factor, factorStrong ); }
@Override protected Color convert( Color source, String key ){ if( key.contains( "selected" )) return convertSelected( Colors.undiffMirror( source, 0.2 ), key ); if( key.contains( "focused" )) return convertFocused( Colors.diffMirror( source, 0.2 ), key ); if( "stack.tab.background.top.mouse".equals( key )) return Colors.fuller( source, 0.3 ); if( "stack.tab.background.bottom.mouse".equals( key )) return Colors.fuller( Colors.diffMirror( source, 0.3 ), 0.3 ); if( "stack.tab.border.mouse".equals( key )) return Colors.fuller( Colors.diffMirror( source, 0.6 ), 0.3 ); if( "stack.tab.foreground.mouse".equals( key )) return Colors.fuller( Colors.diffMirror( source, 0.9 ), 0.3 ); if( "stack.tab.background.top".equals( key )) return source; if( "stack.tab.background.bottom".equals( key )) return Colors.diffMirror( source, 0.3 ); if( "stack.tab.border".equals( key )) return Colors.diffMirror( source, 0.6 ); if( "stack.tab.foreground".equals( key )) return Colors.diffMirror( source, 0.9 ); return null; }
@Override protected Color convertFocused( Color source, String key ){ if( "stack.tab.background.top.focused.mouse".equals( key )) return Colors.fuller( source, 0.3 ); if( "stack.tab.background.bottom.focused.mouse".equals( key )) return Colors.fuller( Colors.diffMirror( source, 0.3 ), 0.3 ); if( "stack.tab.border.focused.mouse".equals( key )) return Colors.fuller( Colors.diffMirror( source, 0.6 ), 0.3 ); if( "stack.tab.foreground.focused.mouse".equals( key )) return Colors.fuller( Colors.diffMirror( source, 0.9 ), 0.3 ); if( "stack.tab.background.top.focused".equals( key )) return source; if( "stack.tab.background.bottom.focused".equals( key )) return Colors.diffMirror( source, 0.3 ); if( "stack.tab.border.focused".equals( key )) return Colors.diffMirror( source, 0.6 ); if( "stack.tab.foreground.focused".equals( key )) return Colors.diffMirror( source, 0.9 ); return null; }
setColor( "stack.tab.border.selected.focused", RexSystemColor.getActiveColorGradient() ); setColor( "stack.tab.border.selected.focuslost",RexSystemColor.getInactiveColor() ); setColor( "stack.tab.border.disabled", Colors.brighter( DockUI.getColor( LookAndFeelColors.PANEL_BACKGROUND ) )); setColor( "stack.tab.top.selected.focused", RexSystemColor.getActiveColor() ); setColor( "stack.tab.top.selected.focuslost", RexSystemColor.getInactiveColor() ); setColor( "stack.tab.top.disabled", Colors.brighter( DockUI.getColor( LookAndFeelColors.PANEL_BACKGROUND ) )); setColor( "stack.tab.bottom.selected.focused", RexSystemColor.getActiveColorGradient() ); setColor( "stack.tab.bottom.selected.focuslost",RexSystemColor.getInactiveColor() ); setColor( "stack.tab.bottom.disabled", Colors.brighter( DockUI.getColor( LookAndFeelColors.PANEL_BACKGROUND ) )); setColor( "stack.border.edges", DockUI.getColor( LookAndFeelColors.PANEL_BACKGROUND ) ); setColor( "flap.button.border.inner", Colors.brighter( RexSystemColor.getBorderColor(), 0.7 ) ); setColor( "flap.button.border.outer", RexSystemColor.getBorderColor() ); setColor( "flap.button.border.edge", DockUI.getColor( LookAndFeelColors.PANEL_BACKGROUND ) );
@Override protected Color convertFocused( Color source, String key ) { if( key.contains( "foreground" ) ) return Colors.diffMirror( source, 1.0 ); if( "title.background.top.active.flap".equals( key )) return Colors.darker( source, 0.3 ); if( "title.background.bottom.active.flap".equals( key )) return Colors.brighter( source, 0.3 ); if( "title.background.top.active.mouse.flap".equals( key )) return Colors.fuller( Colors.darker( source, 0.3 ), 0.3 ); if( "title.background.bottom.active.mouse.flap".equals( key )) return Colors.fuller( Colors.brighter( source, 0.3 ), 0.3 ); return source; }