Browse Source

代码修改

feature/x
kerry 3 weeks ago
parent
commit
f9a596ca45
  1. 19
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java

19
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; return;
} }
for (int i = 0; i < standardColors.size(); i++) { for (int i = 0; i < standardColors.size(); i++) {
@ -451,13 +451,22 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
} }
} }
/**
* 颜色衍生算法
*/
private enum DeriveAlgorithm { private enum DeriveAlgorithm {
/**
* 调整明度和纯度
*/
PLAIN_ALGORITHM { PLAIN_ALGORITHM {
public Color[] getDeriveColorArr(Color color, int defaultDeriveCount) { public Color[] getDeriveColorArr(Color color, int defaultDeriveCount) {
return FineColorDeriveState.getDeriveColorArr(color, false, defaultDeriveCount); return FineColorDeriveState.getDeriveColorArr(color, false, defaultDeriveCount);
} }
}, },
/**
* 只调整明度
*/
DEFAULT_DERIVE_ALGORITHM { DEFAULT_DERIVE_ALGORITHM {
public Color[] getDeriveColorArr(Color color, int defaultDeriveCount) { public Color[] getDeriveColorArr(Color color, int defaultDeriveCount) {
return FineColorDeriveState.getDeriveColorArr(color, true, 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); public abstract Color[] getDeriveColorArr(Color color, int defaultDeriveCount);
} }
/**
* 每个主题色的具体配置
*/
private static class ColorConfig { private static class ColorConfig {
private boolean supportTheme; private boolean supportTheme;
private DeriveAlgorithm algorithm; private DeriveAlgorithm algorithm;
@ -490,6 +502,9 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
} }
} }
/**
* 支持不同风格的主题色选择面板
*/
private enum ColorSelectorStyle { private enum ColorSelectorStyle {
FR, FR,
FVS { FVS {
@ -528,7 +543,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
public ColorConfig getColorConfig(int i) { public ColorConfig getColorConfig(int i) {
List<ColorConfig> colorConfigs = getColorConfigs(); List<ColorConfig> colorConfigs = getColorConfigs();
if (i < 0 || i > colorConfigs.size()) { if (i < 0 || i >= colorConfigs.size()) {
return colorConfigs.get(0); return colorConfigs.get(0);
} }
return colorConfigs.get(i); return colorConfigs.get(i);

Loading…
Cancel
Save