JFormDesigner / FlatLaf

FlatLaf - Swing Look and Feel (with Darcula/IntelliJ themes support)
https://www.formdev.com/flatlaf/
Apache License 2.0
3.42k stars 272 forks source link

How to implement Accent Colour #527

Closed ijabz closed 2 years ago

ijabz commented 2 years ago

The demo has an Accent Color selection (similar to that to on MacOS), its not clear how I would implement that for FlatLaf Light/Dark themes in code?

Also, would be great if there was a way to detect accent color set in MacOS settings so it could be matched. Also, I know its only a demo but when I first tried Accent Color I thought it didnt work because I had an Intellij Theme selected and it doesnt work for them, that wasnt clear to me.

DevCharly commented 2 years ago

The code of the demo is here: https://github.com/JFormDesigner/FlatLaf/blob/c3b9dc397d97a87bff14b6260db649c0acffd519/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.java#L387-L457

Also, would be great if there was a way to detect accent color set in MacOS settings so it could be matched.

Yes, this comes later...

Also, I know its only a demo but when I first tried Accent Color I thought it didnt work because I had an Intellij Theme selected and it doesnt work for them, that wasnt clear to me.

Hmm, the accent buttons are disabled if a IntelliJ theme is active. Wasn't this the case for you? Maybe I should hide them for IntelliJ themes...

ijabz commented 2 years ago

Hmm, the accent buttons are disabled if a IntelliJ theme is active. Wasn't this the case for you? Maybe I should hide them for IntelliJ themes...

Yes they were, but the problem is when I first looked at the Accent colours I already had an IntelliJ theme selected, so I just assumed they were always disabled. it was only by accident that I selected FlatLaf Light and then noticed the accent colours were no longer disabled.

DevCharly commented 2 years ago

Thanks for your feedback. I've changed the demo in commit 96d4bda6c83bb80b4f581426a45d0c012c530e9f. The accent buttons are not visible only for supported themes.