mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 06:20:53 +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 ) {
|
if( value instanceof Color ) {
|
||||||
Color color = (info instanceof Color[]) ? ((Color[])info)[0] : (Color) value;
|
Color color = (info instanceof Color[]) ? ((Color[])info)[0] : (Color) value;
|
||||||
HSLColor hslColor = new HSLColor( color );
|
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 ) {
|
if( color.getAlpha() == 255 ) {
|
||||||
return String.format( "%-9s HSL %3d %3d %3d",
|
return String.format( "%-9s HSL %3d %3d %3d",
|
||||||
color2hex( color ),
|
color2hex( color ), hue, saturation, luminance );
|
||||||
(int) hslColor.getHue(), (int) hslColor.getSaturation(),
|
|
||||||
(int) hslColor.getLuminance() );
|
|
||||||
} else {
|
} else {
|
||||||
|
int alpha = Math.round( hslColor.getAlpha() * 100 );
|
||||||
return String.format( "%-9s HSL %3d %3d %3d %2d",
|
return String.format( "%-9s HSL %3d %3d %3d %2d",
|
||||||
color2hex( color ),
|
color2hex( color ), hue, saturation, luminance, alpha );
|
||||||
(int) hslColor.getHue(), (int) hslColor.getSaturation(),
|
|
||||||
(int) hslColor.getLuminance(), (int) (hslColor.getAlpha() * 100) );
|
|
||||||
}
|
}
|
||||||
} else if( value instanceof Insets ) {
|
} else if( value instanceof Insets ) {
|
||||||
Insets insets = (Insets) value;
|
Insets insets = (Insets) value;
|
||||||
|
|||||||
Reference in New Issue
Block a user