A Java Swing color picker built on FlatLaf, designed to work with built-in and customizable picker models, a color palette, and configurable UI elements.
Add the dependency
<dependency>
<groupId>io.github.dj-raven</groupId>
<artifactId>swing-color-picker</artifactId>
<version>2.0.0</version>
</dependency>To get the latest updates before the release, you can use the snapshot version from Sonatype Central
<repositories>
<repository>
<name>Central Portal Snapshots</name>
<id>central-portal-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
</repository>
</repositories>Add the snapshot version
<dependency>
<groupId>io.github.dj-raven</groupId>
<artifactId>swing-color-picker</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>// create color picker object
ColorPicker colorPicker = new ColorPicker();
// create event color changed
colorPicker.addColorChangedListener((color, event) -> {
// color changed
});Color color = ColorPicker.showDialog(this, "Pick Color", Color.WHITE);
if (color != null) {
// color selected
}// create color picker object with an initial model
ColorPicker colorPicker = new ColorPicker(new DiskColorPickerModel());
// change to a different color picker model
colorPicker.setModel(new CorelTriangleColorPickerModel());| Model Name | Description |
|---|---|
DinoColorPickerModel |
Default HSV color model |
DiskColorPickerModel |
Circular color wheel |
CorelSquareColorPickerModel |
Square color selector with circular hue wheel |
CorelTriangleColorPickerModel |
Triangle selector with circular hue wheel |
CorelRhombusColorPickerModel |
Rhombus selector with circular hue wheel |
- FlatLaf - FlatLaf library for the modern UI design theme
