|
|
|
@ -28,6 +28,13 @@ public class ColorUtils {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 递归的同步颜色,如何组件的背景颜色等于默认颜色的话,变更为 replaceColor |
|
|
|
|
* |
|
|
|
|
* @param component 组件 |
|
|
|
|
* @param replaceColor 替换颜色 |
|
|
|
|
* @param defaultColor 默认颜色 |
|
|
|
|
*/ |
|
|
|
|
public static void syncBackgroundIfAbsent(Component component, Color replaceColor, Color defaultColor) { |
|
|
|
|
|
|
|
|
|
if (component.getBackground() != defaultColor) { |
|
|
|
@ -43,6 +50,11 @@ public class ColorUtils {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 使背景透明 |
|
|
|
|
* |
|
|
|
|
* @param component 组件 |
|
|
|
|
*/ |
|
|
|
|
public static void transparentBackground(Component component) { |
|
|
|
|
|
|
|
|
|
syncBackgroundIfAbsent(component, new Color(0,0,0,0), ThemeUtils.BACK_COLOR); |
|
|
|
|