mirror of https://github.com/weisJ/darklaf.git
weisj
4 years ago
11 changed files with 221 additions and 2 deletions
@ -0,0 +1,86 @@
|
||||
/* |
||||
* 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. |
||||
* |
||||
*/ |
||||
package theme; |
||||
|
||||
import javax.swing.*; |
||||
|
||||
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 { |
||||
|
||||
public static void main(final String[] args) { |
||||
ComponentDemo.showDemo(new ColorPaletteDemo()); |
||||
} |
||||
|
||||
@Override |
||||
public JComponent createComponent() { |
||||
JComponent comp = Box.createVerticalBox(); |
||||
comp.add(Box.createVerticalStrut(5)); |
||||
|
||||
String[] names = { |
||||
"palette.yellow", |
||||
"palette.orange", |
||||
"palette.red", |
||||
"palette.pink", |
||||
"palette.purple", |
||||
"palette.indigo", |
||||
"palette.blue", |
||||
"palette.teal", |
||||
"palette.cyan", |
||||
"palette.green", |
||||
"palette.lime", |
||||
"palette.forest", |
||||
"palette.brown", |
||||
}; |
||||
|
||||
{ |
||||
JComponent p = Box.createVerticalBox(); |
||||
p.setBorder(LayoutHelper.createEmptyContainerBorder()); |
||||
|
||||
for (String name : names) { |
||||
p.add(Box.createVerticalStrut(5)); |
||||
p.add(new JLabel(name, new SolidColorIcon(new ThemedColor(name), 32, 32), JLabel.LEFT)); |
||||
} |
||||
|
||||
comp.add(p); |
||||
comp.add(Box.createVerticalStrut(5)); |
||||
} |
||||
|
||||
return comp; |
||||
} |
||||
|
||||
@Override |
||||
public Theme createTheme() { |
||||
return new OneDarkTheme(); |
||||
} |
||||
|
||||
@Override |
||||
public String getTitle() { |
||||
return "Color Palette"; |
||||
} |
||||
} |
@ -0,0 +1,39 @@
|
||||
# |
||||
# 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.yellow = FFC66D |
||||
%palette.orange = CC7832 |
||||
%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.forest = 007F00 |
||||
%palette.brown = 8A653B |
Loading…
Reference in new issue