mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
UI defaults inspector: round HSL values (as also done in theme editor)
This commit is contained in:
@@ -700,16 +700,16 @@ public class FlatUIDefaultsInspector
|
||||
if( value instanceof Color ) {
|
||||
Color color = (info instanceof Color[]) ? ((Color[])info)[0] : (Color) value;
|
||||
HSLColor hslColor = new HSLColor( color );
|
||||
int hue = Math.round( hslColor.getHue() );
|
||||
int saturation = Math.round( hslColor.getSaturation() );
|
||||
int luminance = Math.round( hslColor.getLuminance() );
|
||||
if( color.getAlpha() == 255 ) {
|
||||
return String.format( "%-9s HSL %3d %3d %3d",
|
||||
color2hex( color ),
|
||||
(int) hslColor.getHue(), (int) hslColor.getSaturation(),
|
||||
(int) hslColor.getLuminance() );
|
||||
color2hex( color ), hue, saturation, luminance );
|
||||
} else {
|
||||
int alpha = Math.round( hslColor.getAlpha() * 100 );
|
||||
return String.format( "%-9s HSL %3d %3d %3d %2d",
|
||||
color2hex( color ),
|
||||
(int) hslColor.getHue(), (int) hslColor.getSaturation(),
|
||||
(int) hslColor.getLuminance(), (int) (hslColor.getAlpha() * 100) );
|
||||
color2hex( color ), hue, saturation, luminance, alpha );
|
||||
}
|
||||
} else if( value instanceof Insets ) {
|
||||
Insets insets = (Insets) value;
|
||||
|
||||
Reference in New Issue
Block a user