flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java
private void applyCheckBoxColors( UIDefaults defaults ) {
		if( icons == null )
			return;

		Object palette = icons.get( "ColorPalette" );
		if( !(palette instanceof Map) )
			return;

		boolean checkboxModified = false;
		@SuppressWarnings( "unchecked" )
		Map<String, Object> colorPalette = (Map<String, Object>) palette;
		for( Map.Entry<String, Object> e : colorPalette.entrySet() ) {
			String key = e.getKey();
			Object value = e.getValue();
			if( !key.startsWith( "Checkbox." ) || !(value instanceof String) )
				continue;

			if( key.equals( "Checkbox.Background.Default" ) ||
				key.equals( "Checkbox.Foreground.Selected" ) )
			{
				// This two keys do not work correctly in IDEA because they
				// map SVG color "#ffffff" to another color, but checkBox.svg and
				// radio.svg (in package com.intellij.ide.ui.laf.icons.intellij)
				// use "#fff". So use white to get same appearance as in IDEA.
				value = "#ffffff";
			}

			String key2 = checkboxDuplicateColors.get( key );

			if( dark )
				key = StringUtils.removeTrailing( key, ".Dark" );

			String newKey = checkboxKeyMapping.get( key );
			if( newKey != null ) {
				String checkBoxIconPrefix = "CheckBox.icon.";
				if( !dark && newKey.startsWith( checkBoxIconPrefix ) )
					newKey = "CheckBox.icon[filled].".concat( newKey.substring( checkBoxIconPrefix.length() ) );

				ColorUIResource color = toColor( (String) value );
				if( color != null ) {
					defaults.put( newKey, color );

					if( key2 != null ) {
						// When IDEA replaces colors in SVGs it uses color values and not the keys
						// from com.intellij.ide.ui.UITheme.colorPalette, but there are some keys that
						// have same color value:
						//   - Checkbox.Background.Default.Dark  has same color as  Checkbox.Background.Selected.Dark
						//   - Checkbox.Border.Default.Dark      has same color as  Checkbox.Border.Selected.Dark
						//   - Checkbox.Focus.Thin.Default.Dark  has same color as  Checkbox.Focus.Thin.Selected.Dark
						//
						// So if only e.g. Checkbox.Background.Default.Dark is specified in .theme.json,
						// then this color is also used for Checkbox.Background.Selected.Dark.
						//
						// If Checkbox.Background.Default.Dark and Checkbox.Background.Selected.Dark
						// are specified in .theme.json, then the later specified is used for both.
						if( dark )
							key2 = StringUtils.removeTrailing( key2, ".Dark" );

						String newKey2 = checkboxKeyMapping.get( key2 );
						if( newKey2 != null )
							defaults.put( newKey2, color );
					}
				}

				checkboxModified = true;
			}
		}

		// update hover, pressed and focused colors
		if( checkboxModified ) {
			// for non-filled checkbox/radiobutton used in dark themes
			defaults.remove( "CheckBox.icon.focusWidth" );
			defaults.put( "CheckBox.icon.hoverBorderColor", defaults.get( "CheckBox.icon.focusedBorderColor" ) );

			// for filled checkbox/radiobutton used in light themes
			defaults.remove( "CheckBox.icon[filled].focusWidth" );
			defaults.put( "CheckBox.icon[filled].hoverBorderColor", defaults.get( "CheckBox.icon[filled].focusedBorderColor" ) );
			defaults.put( "CheckBox.icon[filled].selectedFocusedBackground", defaults.get( "CheckBox.icon[filled].selectedBackground" ) );

			if( dark ) {
				// IDEA Darcula checkBoxFocused.svg, checkBoxSelectedFocused.svg,
				// radioFocused.svg and radioSelectedFocused.svg
				// use opacity=".65" for the border
				// --> add alpha to focused border colors
				String[] focusedBorderColorKeys = new String[] {
					"CheckBox.icon.focusedBorderColor",
					"CheckBox.icon.selectedFocusedBorderColor",
					"CheckBox.icon[filled].focusedBorderColor",
					"CheckBox.icon[filled].selectedFocusedBorderColor",
				};
				for( String key : focusedBorderColorKeys ) {
					Color color = defaults.getColor( key );
					if( color != null ) {
						defaults.put( key, new ColorUIResource( new Color(
							(color.getRGB() & 0xffffff) | 0xa6000000, true ) ) );
					}
				}
			}
		}
	}
/**
	 * Because IDEA uses SVGs for check boxes and radio buttons, the colors for
	 * this two components are specified in "icons > ColorPalette".
	 * FlatLaf uses vector icons and expects colors for the two components in UI defaults.
	 */
Because IDEA uses SVGs for check boxes and radio buttons, the colors for
this two components are specified in "icons > ColorPalette".
FlatLaf uses vector icons and expects colors for the two components in UI defaults.
Because IDEA uses SVGs for check boxes and radio buttons the colors for this two components are specified in " icons > ColorPalette " . FlatLaf uses vector icons and expects colors for the two components in UI defaults .
private void applyCheckBoxColors( UIDefaults defaults ) {
		if( icons == null )
			return;
		Object palette = icons.get( "ColorPalette" );
		if( !(palette instanceof Map) )
			return;
		boolean checkboxModified = false;
		@SuppressWarnings( "unchecked" )
		Map<String, Object> colorPalette = (Map<String, Object>) palette;
		for( Map.Entry<String, Object> e : colorPalette.entrySet() ) {
			String key = e.getKey();
			Object value = e.getValue();
			if( !key.startsWith( "Checkbox." ) || !(value instanceof String) )
				continue;
			if( key.equals( "Checkbox.Background.Default" ) ||
				key.equals( "Checkbox.Foreground.Selected" ) )
			{
				value = "#ffffff";
			}
			String key2 = checkboxDuplicateColors.get( key );
			if( dark )
				key = StringUtils.removeTrailing( key, ".Dark" );
			String newKey = checkboxKeyMapping.get( key );
			if( newKey != null ) {
				String checkBoxIconPrefix = "CheckBox.icon.";
				if( !dark && newKey.startsWith( checkBoxIconPrefix ) )
					newKey = "CheckBox.icon[filled].".concat( newKey.substring( checkBoxIconPrefix.length() ) );
				ColorUIResource color = toColor( (String) value );
				if( color != null ) {
					defaults.put( newKey, color );
					if( key2 != null ) {
						 So if only e.g. Checkbox.Background.Default.Dark is specified in .theme.json,
						 then this color is also used for Checkbox.Background.Selected.Dark.
						 If Checkbox.Background.Default.Dark and Checkbox.Background.Selected.Dark
						 are specified in .theme.json, then the later specified is used for both.
						if( dark )
							key2 = StringUtils.removeTrailing( key2, ".Dark" );
						String newKey2 = checkboxKeyMapping.get( key2 );
						if( newKey2 != null )
							defaults.put( newKey2, color );
					}
				}
				checkboxModified = true;
			}
		}
		 update hover, pressed and focused colors
		if( checkboxModified ) {
			 for non-filled checkbox/radiobutton used in dark themes
			defaults.remove( "CheckBox.icon.focusWidth" );
			defaults.put( "CheckBox.icon.hoverBorderColor", defaults.get( "CheckBox.icon.focusedBorderColor" ) );
			 for filled checkbox/radiobutton used in light themes
			defaults.remove( "CheckBox.icon[filled].focusWidth" );
			defaults.put( "CheckBox.icon[filled].hoverBorderColor", defaults.get( "CheckBox.icon[filled].focusedBorderColor" ) );
			defaults.put( "CheckBox.icon[filled].selectedFocusedBackground", defaults.get( "CheckBox.icon[filled].selectedBackground" ) );
			if( dark ) {
				 IDEA Darcula checkBoxFocused.svg, checkBoxSelectedFocused.svg,
				 radioFocused.svg and radioSelectedFocused.svg
				 use opacity=".65" for the border
				 --> add alpha to focused border colors
				String[] focusedBorderColorKeys = new String[] {
					"CheckBox.icon.focusedBorderColor",
					"CheckBox.icon.selectedFocusedBorderColor",
					"CheckBox.icon[filled].focusedBorderColor",
					"CheckBox.icon[filled].selectedFocusedBorderColor",
				};
				for( String key : focusedBorderColorKeys ) {
					Color color = defaults.getColor( key );
					if( color != null ) {
						defaults.put( key, new ColorUIResource( new Color(
							(color.getRGB() & 0xffffff) | 0xa6000000, true ) ) );
					}
				}
			}
		}
	}
private void applyCheckBoxColors ( UIDefaults defaults ) { if ( icons == null ) return ; Object palette = icons . get ( "ColorPalette" ) ; if ( ! ( palette instanceof Map ) ) return ; boolean checkboxModified = false ; @ SuppressWarnings ( "unchecked" ) Map < String , Object > colorPalette = ( Map < String , Object > ) palette ; for ( Map . Entry < String , Object > e : colorPalette . entrySet ( ) ) { String key = e . getKey ( ) ; Object value = e . getValue ( ) ; if ( ! key . startsWith ( "Checkbox." ) || ! ( value instanceof String ) ) continue ; if ( key . equals ( "Checkbox.Background.Default" ) || key . equals ( "Checkbox.Foreground.Selected" ) ) { value = "#ffffff" ; } String key2 = checkboxDuplicateColors . get ( key ) ; if ( dark ) key = StringUtils . removeTrailing ( key , ".Dark" ) ; String newKey = checkboxKeyMapping . get ( key ) ; if ( newKey != null ) { String checkBoxIconPrefix = "CheckBox.icon." ; if ( ! dark && newKey . startsWith ( checkBoxIconPrefix ) ) newKey = "CheckBox.icon[filled]." . concat ( newKey . substring ( checkBoxIconPrefix . length ( ) ) ) ; ColorUIResource color = toColor ( ( String ) value ) ; if ( color != null ) { defaults . put ( newKey , color ) ; if ( key2 != null ) { if ( dark ) key2 = StringUtils . removeTrailing ( key2 , ".Dark" ) ; String newKey2 = checkboxKeyMapping . get ( key2 ) ; if ( newKey2 != null ) defaults . put ( newKey2 , color ) ; } } checkboxModified = true ; } } if ( checkboxModified ) { defaults . remove ( "CheckBox.icon.focusWidth" ) ; defaults . put ( "CheckBox.icon.hoverBorderColor" , defaults . get ( "CheckBox.icon.focusedBorderColor" ) ) ; defaults . remove ( "CheckBox.icon[filled].focusWidth" ) ; defaults . put ( "CheckBox.icon[filled].hoverBorderColor" , defaults . get ( "CheckBox.icon[filled].focusedBorderColor" ) ) ; defaults . put ( "CheckBox.icon[filled].selectedFocusedBackground" , defaults . get ( "CheckBox.icon[filled].selectedBackground" ) ) ; if ( dark ) { String [ ] focusedBorderColorKeys = new String [ ] { "CheckBox.icon.focusedBorderColor" , "CheckBox.icon.selectedFocusedBorderColor" , "CheckBox.icon[filled].focusedBorderColor" , "CheckBox.icon[filled].selectedFocusedBorderColor" , } ; for ( String key : focusedBorderColorKeys ) { Color color = defaults . getColor ( key ) ; if ( color != null ) { defaults . put ( key , new ColorUIResource ( new Color ( ( color . getRGB ( ) & 0xffffff ) | 0xa6000000 , true ) ) ) ; } } } } }
Because IDEA uses SVGs for check boxes and radio buttons, the colors for
 this two components are specified in "icons > ColorPalette".
Because IDEA uses SVGs for check boxes and radio buttons the colors for this two components are specified in " icons > ColorPalette " .
// This two keys do not work correctly in IDEA because they // map SVG color "#ffffff" to another color, but checkBox.svg and // radio.svg (in package com.intellij.ide.ui.laf.icons.intellij) // use "#fff". So use white to get same appearance as in IDEA. // When IDEA replaces colors in SVGs it uses color values and not the keys // from com.intellij.ide.ui.UITheme.colorPalette, but there are some keys that // have same color value: //   - Checkbox.Background.Default.Dark  has same color as  Checkbox.Background.Selected.Dark //   - Checkbox.Border.Default.Dark      has same color as  Checkbox.Border.Selected.Dark //   - Checkbox.Focus.Thin.Default.Dark  has same color as  Checkbox.Focus.Thin.Selected.Dark // // So if only e.g. Checkbox.Background.Default.Dark is specified in .theme.json, // then this color is also used for Checkbox.Background.Selected.Dark. // // If Checkbox.Background.Default.Dark and Checkbox.Background.Selected.Dark // are specified in .theme.json, then the later specified is used for both. // update hover, pressed and focused colors // for non-filled checkbox/radiobutton used in dark themes // for filled checkbox/radiobutton used in light themes // IDEA Darcula checkBoxFocused.svg, checkBoxSelectedFocused.svg, // radioFocused.svg and radioSelectedFocused.svg // use opacity=".65" for the border // --> add alpha to focused border colors