Substance Look and Feel is making my colors brighter?
This SSCCE shows the color in your Photoshop sample:
public class ColorTest {
public static void main(String[] args) {
JLabel label = new JLabel("Java Color");
label.setFont(label.getFont().deriveFont(20f));
label.setForeground(Color.WHITE);
label.setBackground(new Color(0x94b3c7));
label.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
label.setOpaque(true);
JPanel jpanel = new JPanel();
jpanel.setOpaque(true);
jpanel.add(label);
jpanel.setBackground(Color.GREEN);
JFrame frame = new JFrame();
frame.setContentPane(jpanel);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}
Perhaps this helps reveal to you how you should be setting the color to get what you want?
Edit: Now added explicit setting of opaque to try to solve Substance L&F problem.
Substance is 'colorizing' your background colors to try and add some of the theme's color. If you used different skins, you would get different results. The Autumn skin, for example, would make things very orange. This can be changed on a component per component basis by setting the client property org.pushingpixels.substance.api.SubstanceLookAndFeel#COLORIZATION_FACTOR
to 1.0
. For example:
frame.putClientProperty(SubstanceLookAndFeel.COLORIZATION_FACTOR, 1.0)
This will instruct the background painter to use 100% of the user specified background color, rather than using 50% of the color.
This can also be set globally...
UIManager.put(SubstanceLookAndFeel.COLORIZATION_FACTOR, 1.0);
again, subject to per component overrides. If not set the defaults colorization factor is 0.5
.
So I've found the problem. It's actually kind of annoying, and I probably should have added this in the question, but I never thought that this was causing the problem.
Se im using something called Substance.api
from the webpage http://www.pushing-pixels.org
Its a colorskin for the GUI, My intention was to change the color of the JFrame, but insted I changed the whole color proof.
So if someone knows how to change the JFrame Color, hawla at me! :)
This is the bandit code:
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel(new SubstanceRavenLookAndFeel());
} catch (Exception e) {
}
}
});
}