From f9a596ca45dced3cc6a511c2c60c77332a0eca67 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 2 Dec 2024 11:06:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/color/NewColorSelectPane.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index fd07f23932..3a9c37a5f1 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -219,7 +219,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { } } } - if (standardColors == null || standardColors.size() < 8 || standardColors.size() > 10) { + if (standardColors == null || standardColors.size() < 8) { return; } for (int i = 0; i < standardColors.size(); i++) { @@ -451,13 +451,22 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { } } + /** + * 颜色衍生算法 + */ private enum DeriveAlgorithm { + /** + * 调整明度和纯度 + */ PLAIN_ALGORITHM { public Color[] getDeriveColorArr(Color color, int defaultDeriveCount) { return FineColorDeriveState.getDeriveColorArr(color, false, defaultDeriveCount); } }, + /** + * 只调整明度 + */ DEFAULT_DERIVE_ALGORITHM { public Color[] getDeriveColorArr(Color color, int defaultDeriveCount) { return FineColorDeriveState.getDeriveColorArr(color, true, defaultDeriveCount); @@ -467,6 +476,9 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { public abstract Color[] getDeriveColorArr(Color color, int defaultDeriveCount); } + /** + * 每个主题色的具体配置 + */ private static class ColorConfig { private boolean supportTheme; private DeriveAlgorithm algorithm; @@ -490,6 +502,9 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { } } + /** + * 支持不同风格的主题色选择面板 + */ private enum ColorSelectorStyle { FR, FVS { @@ -528,7 +543,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { public ColorConfig getColorConfig(int i) { List colorConfigs = getColorConfigs(); - if (i < 0 || i > colorConfigs.size()) { + if (i < 0 || i >= colorConfigs.size()) { return colorConfigs.get(0); } return colorConfigs.get(i);