Browse Source

Group palette colors in icon editor.

Add gray color to palette.
pull/222/head
weisj 4 years ago
parent
commit
b1cebab636
  1. 8
      core/src/main/java/com/github/weisj/darklaf/components/iconeditor/IconEditorPanel.java
  2. 8
      core/src/test/java/theme/ColorPaletteDemo.java
  3. 6
      theme/src/main/java/com/github/weisj/darklaf/theme/IntelliJTheme.java
  4. 17
      theme/src/main/resources/com/github/weisj/darklaf/theme/darcula/darcula_icons.properties
  5. 1
      theme/src/main/resources/com/github/weisj/darklaf/theme/icon_presets/dark_icons.properties
  6. 2
      theme/src/main/resources/com/github/weisj/darklaf/theme/icon_presets/light_icons.properties
  7. 27
      theme/src/main/resources/com/github/weisj/darklaf/theme/intellij/intellij_icons.properties
  8. 1
      theme/src/main/resources/com/github/weisj/darklaf/theme/one_dark/one_dark_icons.properties
  9. 2
      theme/src/main/resources/com/github/weisj/darklaf/theme/solarized_dark/solarized_dark_icons.properties
  10. 1
      theme/src/main/resources/com/github/weisj/darklaf/theme/solarized_light/solarized_light_icons.properties

8
core/src/main/java/com/github/weisj/darklaf/components/iconeditor/IconEditorPanel.java

@ -392,6 +392,14 @@ public class IconEditorPanel extends JPanel {
.collect(Collectors.toList());
defaults.colors = entries.stream()
.map(p -> new NamedColor(p.getFirst(), p.getSecond()))
.sorted((c1, c2) -> {
String n1 = c1.getName();
String n2 = c2.getName();
boolean p1 = n1.startsWith("palette.");
boolean p2 = n2.startsWith("palette.");
if (p1 == p2) return n1.compareTo(n2);
return Boolean.compare(p1, p2);
})
.collect(Collectors.toList());
}
return new ColorPaletteChooser(defaults.colors);

8
core/src/test/java/theme/ColorPaletteDemo.java

@ -28,8 +28,6 @@ import ui.ComponentDemo;
import com.github.weisj.darklaf.graphics.ThemedColor;
import com.github.weisj.darklaf.icons.SolidColorIcon;
import com.github.weisj.darklaf.layout.LayoutHelper;
import com.github.weisj.darklaf.theme.OneDarkTheme;
import com.github.weisj.darklaf.theme.Theme;
public class ColorPaletteDemo implements ComponentDemo {
@ -56,6 +54,7 @@ public class ColorPaletteDemo implements ComponentDemo {
"palette.lime",
"palette.forest",
"palette.brown",
"palette.gray",
};
{
@ -74,11 +73,6 @@ public class ColorPaletteDemo implements ComponentDemo {
return comp;
}
@Override
public Theme createTheme() {
return new OneDarkTheme();
}
@Override
public String getTitle() {
return "Color Palette";

6
theme/src/main/java/com/github/weisj/darklaf/theme/IntelliJTheme.java

@ -71,6 +71,12 @@ public class IntelliJTheme extends Theme {
loadCustomProperties("ui", properties, currentDefaults);
}
@Override
public void customizeIconTheme(final Properties properties, final UIDefaults currentDefaults) {
super.customizeIconTheme(properties, currentDefaults);
loadCustomProperties("icons", properties, currentDefaults);
}
@Override
public boolean supportsCustomAccentColor() {
return true;

17
theme/src/main/resources/com/github/weisj/darklaf/theme/darcula/darcula_icons.properties

@ -26,14 +26,15 @@
#
%palette.yellow = FFC66D
%palette.orange = CC7832
%palette.red = BC3F32
%palette.pink = AE8ABE
%palette.red = BC3F32
%palette.pink = AE8ABE
%palette.purple = AB51BA
%palette.indigo = 507874
%palette.blue = 5394EC
%palette.teal = 6897BB
%palette.cyan = 299999
%palette.green = 629755
%palette.lime = A8C023
%palette.blue = 5394EC
%palette.teal = 6897BB
%palette.cyan = 299999
%palette.green = 629755
%palette.lime = A8C023
%palette.forest = 007F00
%palette.brown = 8A653B
%palette.brown = 8A653B
%palette.gray = AFB1B3

1
theme/src/main/resources/com/github/weisj/darklaf/theme/icon_presets/dark_icons.properties

@ -65,3 +65,4 @@
%palette.lime = 69B320
%palette.forest = 13591E
%palette.brown = AC8E68
%palette.gray = 98989D

2
theme/src/main/resources/com/github/weisj/darklaf/theme/icon_presets/light_icons.properties

@ -65,3 +65,5 @@
%palette.lime = 93FA2D
%palette.forest = 176F24
%palette.brown = A2845E
%palette.gray = 8E8E93

27
theme/src/main/resources/com/github/weisj/darklaf/theme/intellij/intellij_icons.properties

@ -0,0 +1,27 @@
#
# MIT License
#
# Copyright (c) 2020 Jannis Weis
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
#
# suppress inspection "UnusedProperty" for whole file
#
%palette.gray = 6E6E6E

1
theme/src/main/resources/com/github/weisj/darklaf/theme/one_dark/one_dark_icons.properties

@ -65,3 +65,4 @@
%palette.lime = 69B320
%palette.forest = 13591E
%palette.brown = AC8E68
%palette.gray = ABB2BF

2
theme/src/main/resources/com/github/weisj/darklaf/theme/solarized_dark/solarized_dark_icons.properties

@ -65,3 +65,5 @@
%palette.forest = 365936
%palette.lime = 859900
%palette.brown = 584E31
%palette.gray = 93A1A1

1
theme/src/main/resources/com/github/weisj/darklaf/theme/solarized_light/solarized_light_icons.properties

@ -65,3 +65,4 @@
%palette.forest = 365936
%palette.lime = 859900
%palette.brown = 584E31
%palette.gray = 586E75

Loading…
Cancel
Save