Search in sources :

Example 1 with DynamicColor

use of com.github.weisj.darklaf.properties.color.DynamicColor in project darklaf by weisJ.

the class ColorPaletteDemo method createComponent.

@Override
public JComponent createComponent() {
    JComponent comp = Box.createVerticalBox();
    comp.add(Box.createVerticalStrut(5));
    {
        JComponent p = Box.createVerticalBox();
        p.setBorder(LayoutHelper.createEmptyContainerBorder());
        List<Color> palette = Arrays.asList(ColorPalette.YELLOW, ColorPalette.ORANGE, ColorPalette.RED, ColorPalette.PINK, ColorPalette.PURPLE, ColorPalette.INDIGO, ColorPalette.BLUE, ColorPalette.TEAL, ColorPalette.CYAN, ColorPalette.GREEN, ColorPalette.LIME, ColorPalette.FOREST, ColorPalette.BROWN, ColorPalette.GRAY);
        for (Color color : palette) {
            p.add(Box.createVerticalStrut(5));
            p.add(new JLabel(((DynamicColor) color).getKey(), new SolidColorIcon(color, 32, 32), JLabel.LEFT));
        }
        comp.add(p);
        comp.add(Box.createVerticalStrut(5));
    }
    return comp;
}
Also used : SolidColorIcon(com.github.weisj.darklaf.properties.icons.SolidColorIcon) Color(java.awt.Color) DynamicColor(com.github.weisj.darklaf.properties.color.DynamicColor) JComponent(javax.swing.JComponent) JLabel(javax.swing.JLabel) List(java.util.List)

Aggregations

DynamicColor (com.github.weisj.darklaf.properties.color.DynamicColor)1 SolidColorIcon (com.github.weisj.darklaf.properties.icons.SolidColorIcon)1 Color (java.awt.Color)1 List (java.util.List)1 JComponent (javax.swing.JComponent)1 JLabel (javax.swing.JLabel)1