@Override
		protected void paintComponent( Graphics g ) {
			if( item.value instanceof Color ) {
				int width = getWidth();
				int height = getHeight();
				Color background = valueColor;

				// paint color
				fillRect( g, background, 0, 0, width, height );

				if( item.info instanceof Color[] ) {
					// paint base color
					int width2 = height * 2;
					fillRect( g, ((Color[])item.info)[1], width - width2, 0, width2, height );

					// paint default color
					Color defaultColor = (Color) item.value;
					if( defaultColor != null && !defaultColor.equals( background ) ) {
						int width3 = height / 2;
						fillRect( g, defaultColor, width - width3, 0, width3, height );
					}

					// paint "derived color" indicator
					int width4 = height / 4;
					g.setColor( Color.magenta );
					g.fillRect( width - width4, 0, width4, height );
				}

				// layout text
				FontMetrics fm = getFontMetrics( getFont() );
				String text = getText();
				Rectangle textR = new Rectangle();
				layoutLabel( fm, text, textR );
				int x = textR.x;
				int y = textR.y + fm.getAscent();

				g.setColor( getForeground() );

				// paint hsl horizontally aligned
				int hslIndex = text.indexOf( "HSL" );
				if( hslIndex > 0 ) {
					String hexText = text.substring( 0, hslIndex );
					String hslText = text.substring( hslIndex );
					int hexWidth = Math.max( fm.stringWidth( hexText ), fm.stringWidth( "#12345678  " ) );
					FlatUIUtils.drawString( this, g, hexText, x, y );
					FlatUIUtils.drawString( this, g, hslText, x + hexWidth, y );
				} else
					FlatUIUtils.drawString( this, g, text, x, y );
			} else
				super.paintComponent( g );

			paintSeparator( g );
		}
Creates a UI defaults inspector panel that can be embedded into any window.
flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatUIDefaultsInspector.java