pantone中的rgb替换
This commit is contained in:
@@ -149,14 +149,19 @@ public class PanToneServiceImpl extends ServiceImpl<PanToneMapper, PanTone> impl
|
|||||||
|
|
||||||
// 5. 处理缺失的 Pantone 数据,创建默认的 PantoneVO
|
// 5. 处理缺失的 Pantone 数据,创建默认的 PantoneVO
|
||||||
for (Integer colorIndex : colorIndexes) {
|
for (Integer colorIndex : colorIndexes) {
|
||||||
|
String rgbValue = colorIndexRgb.get(colorIndex);
|
||||||
|
int[] rgb = Arrays.stream(rgbValue.split("\\s+")).mapToInt(Integer::parseInt).toArray();
|
||||||
if (!pantoneVOMap.containsKey(colorIndex)) {
|
if (!pantoneVOMap.containsKey(colorIndex)) {
|
||||||
String rgbValue = colorIndexRgb.get(colorIndex);
|
|
||||||
int[] rgb = Arrays.stream(rgbValue.split("\\s+")).mapToInt(Integer::parseInt).toArray();
|
|
||||||
PantoneVO defaultPantoneVO = new PantoneVO();
|
PantoneVO defaultPantoneVO = new PantoneVO();
|
||||||
defaultPantoneVO.setR(rgb[0]);
|
defaultPantoneVO.setR(rgb[0]);
|
||||||
defaultPantoneVO.setG(rgb[1]);
|
defaultPantoneVO.setG(rgb[1]);
|
||||||
defaultPantoneVO.setB(rgb[2]);
|
defaultPantoneVO.setB(rgb[2]);
|
||||||
pantoneVOMap.put(colorIndex, defaultPantoneVO);
|
pantoneVOMap.put(colorIndex, defaultPantoneVO);
|
||||||
|
} else {
|
||||||
|
PantoneVO pantoneVO = pantoneVOMap.get(colorIndex);
|
||||||
|
pantoneVO.setR(rgb[0]);
|
||||||
|
pantoneVO.setG(rgb[1]);
|
||||||
|
pantoneVO.setB(rgb[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user