design detail代码转移,临时存储
This commit is contained in:
59
src/main/java/com/ai/da/common/utils/PantoneUtils.java
Normal file
59
src/main/java/com/ai/da/common/utils/PantoneUtils.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package com.ai.da.common.utils;
|
||||
|
||||
public class PantoneUtils {
|
||||
|
||||
public static int[] rgbToHsv(int[] rgb) {
|
||||
//切割rgb数组
|
||||
int R = rgb[0];
|
||||
int G = rgb[1];
|
||||
int B = rgb[2];
|
||||
//公式运算 /255
|
||||
float R_1 = R / 255f;
|
||||
float G_1 = G / 255f;
|
||||
float B_1 = B / 255f;
|
||||
//重新拼接运算用数组
|
||||
float[] all = {R_1, G_1, B_1};
|
||||
float max = all[0];
|
||||
float min = all[0];
|
||||
//循环查找最大值和最小值
|
||||
for (int i = 0; i < all.length; i++) {
|
||||
if (max <= all[i]) {
|
||||
max = all[i];
|
||||
}
|
||||
if (min >= all[i]) {
|
||||
min = all[i];
|
||||
}
|
||||
}
|
||||
float C_max = max;
|
||||
float C_min = min;
|
||||
//计算差值
|
||||
float diff = C_max - C_min;
|
||||
float hue = 0f;
|
||||
//判断情况计算色调H
|
||||
if (diff == 0f) {
|
||||
hue = 0f;
|
||||
} else {
|
||||
if (C_max == R_1) {
|
||||
hue = (((G_1 - B_1) / diff) % 6) * 60f;
|
||||
}
|
||||
if (C_max == G_1) {
|
||||
hue = (((B_1 - R_1) / diff) + 2f) * 60f;
|
||||
}
|
||||
if (C_max == B_1) {
|
||||
hue = (((R_1 - G_1) / diff) + 4f) * 60f;
|
||||
}
|
||||
}
|
||||
//计算饱和度S
|
||||
float saturation;
|
||||
if (C_max == 0f) {
|
||||
saturation = 0f;
|
||||
} else {
|
||||
saturation = diff / C_max;
|
||||
}
|
||||
//计算明度V
|
||||
float value = C_max;
|
||||
int[] result = {Math.round(hue), Math.round(saturation * 100), Math.round(value * 100)};
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package com.ai.da.controller;
|
||||
import com.ai.da.common.response.Response;
|
||||
import com.ai.da.model.dto.*;
|
||||
import com.ai.da.model.vo.DesignCollectionVO;
|
||||
import com.ai.da.model.vo.DesignItemDetailVO;
|
||||
import com.ai.da.model.vo.DesignLikeVO;
|
||||
import com.ai.da.service.DesignService;
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
@@ -26,7 +26,8 @@ public class DesignItemClothesDetailVO {
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty(" 颜色 存 RGB值 中间空格分隔 比如 58 58 169")
|
||||
private String color;
|
||||
// private String color;
|
||||
private PantoneVO color;
|
||||
|
||||
@ApiModelProperty("对应的print图片对象")
|
||||
private DesignPythonItemPrint printObject;
|
||||
|
||||
@@ -15,7 +15,7 @@ public class DesignItemDetailVO {
|
||||
private Long designItemId;
|
||||
|
||||
@ApiModelProperty("designItem图片")
|
||||
private String designItemUrl;
|
||||
private DesignPythonOutfitVO designItemUrl;
|
||||
|
||||
@ApiModelProperty("design高级图片")
|
||||
private String highDesignUrl;
|
||||
|
||||
@@ -19,7 +19,8 @@ public class DesignItemOthersDetailVO {
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty(" 颜色 存 RGB值 中间空格分隔 比如 58 58 169")
|
||||
private String color;
|
||||
// private String color;
|
||||
private PantoneVO color;
|
||||
|
||||
@ApiModelProperty("对应的print图片的绝对路径")
|
||||
private DesignPythonItemPrint printObject;
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ai.da.model.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("designItem detail layer响应")
|
||||
public class DesignPythonOutfitDetailVO {
|
||||
|
||||
@ApiModelProperty("各图层id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("图片所属分类 earring_back/front,hairstyle_back/front,skirt_back/front,shoes_left/right,body 等")
|
||||
private String imageCategory;
|
||||
|
||||
@ApiModelProperty("图片url")
|
||||
private String imageUrl;
|
||||
|
||||
@ApiModelProperty("蒙版url")
|
||||
private String maskUrl;
|
||||
|
||||
@ApiModelProperty("坐标")
|
||||
private String position;
|
||||
|
||||
@ApiModelProperty("优先级")
|
||||
private Integer priority;
|
||||
}
|
||||
21
src/main/java/com/ai/da/model/vo/DesignPythonOutfitVO.java
Normal file
21
src/main/java/com/ai/da/model/vo/DesignPythonOutfitVO.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.ai.da.model.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel("designItem detail从python端获取的合成图+各图层响应")
|
||||
public class DesignPythonOutfitVO {
|
||||
|
||||
@ApiModelProperty("designPythonOutfitId")
|
||||
private Long designPythonOutfitId;
|
||||
|
||||
@ApiModelProperty("合成图")
|
||||
String designPythonOutfitUrl;
|
||||
|
||||
@ApiModelProperty("各部分图层信息")
|
||||
List<DesignPythonOutfitDetailVO> designItemDetailLayers;
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import javax.validation.constraints.NotBlank;
|
||||
@ApiModel("潘通-响应")
|
||||
public class PantoneVO {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
@ApiModelProperty("id -> pantoneIndex")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("名字")
|
||||
|
||||
@@ -41,6 +41,8 @@ public interface PanToneService extends IService<PanTone> {
|
||||
*/
|
||||
PantoneVO getByRGB(Integer r,Integer g,Integer b);
|
||||
|
||||
PantoneVO getPantoneByRgb(String color);
|
||||
|
||||
/**
|
||||
* 根据hsv批量查询
|
||||
* @param rgbByHsvBatch
|
||||
|
||||
@@ -157,6 +157,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
||||
LibraryModelPoint modelPoint = libraryModelPointService.getById(design.getTemplateId());
|
||||
Assert.notNull(modelPoint,"template does not exists!");
|
||||
Library library = libraryService.getById(modelPoint.getLibraryId());
|
||||
// ??和上面重复
|
||||
Assert.notNull(modelPoint,"template does not exists!");
|
||||
designLibraryModelPointVO = collectionElementService.calculateTemplatePoint(modelPoint,library.getHigh(),library.getWidth(),library.getUrl());
|
||||
}
|
||||
@@ -170,6 +171,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
||||
//designSingle
|
||||
DesignCollectionItemVO response = saveSingleDesignItemAndDetail(objects,design.getId(),designSingleDTO.getDesignItemId(),
|
||||
design.getCollectionId(),userInfo,designSingleDTO.getTimeZone());
|
||||
// ??
|
||||
designItem.setDesignUrl(response.getDesignItemUrl());
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.jsqlparser.expression.operators.relational.OldOracleJoinBinaryExpression;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -74,6 +75,8 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
private SysFileService sysFileService;
|
||||
@Resource
|
||||
private TCollectionElementRelationService tCollectionElementRelationService;
|
||||
@Resource
|
||||
private PanToneService panToneService;
|
||||
|
||||
// @Transactional
|
||||
@Override
|
||||
@@ -528,11 +531,14 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
Assert.notNull(design,"design does not exist!");
|
||||
List<DesignItemDetail> designItemDetails = designItemDetailService.selectByDesignItemId(designItemId);
|
||||
Assert.notEmpty(designItemDetails,"designItemDetails does not exist!");
|
||||
// 添加判断designPythonOutfitId是否存在
|
||||
|
||||
|
||||
DesignItemDetailVO response = new DesignItemDetailVO();
|
||||
response.setSingleOverall(design.getSingleOverall());
|
||||
response.setSwitchCategory(design.getSwitchCategory());
|
||||
response.setDesignItemId(designItemId);
|
||||
response.setDesignItemUrl(designItem.getDesignUrl());
|
||||
// response.setDesignItemUrl(designItem.getDesignUrl());
|
||||
response.setHighDesignUrl(designItem.getHighDesignUrl());
|
||||
List<DesignItemDetail> filterDetail = designItemDetails.stream()
|
||||
.filter(f -> OUTWEAR_DRESS_BLOUSE.contains(f.getType()) || SKIRT_TROUSERS.contains(f.getType()))
|
||||
@@ -556,7 +562,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
d.setId(o.getBusinessId());
|
||||
d.setPrintObject(new DesignPythonItemPrint());
|
||||
}));
|
||||
return response;
|
||||
return editResponseColor(designItemDetails,response);
|
||||
}
|
||||
private String converTypeToLevel1(String type){
|
||||
if(StringUtils.isEmpty(type)){
|
||||
@@ -596,5 +602,46 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
return design.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param designItemDetails
|
||||
* @param designItemDetailVO
|
||||
* @return
|
||||
*/
|
||||
private DesignItemDetailVO editResponseColor(List<DesignItemDetail> designItemDetails,DesignItemDetailVO designItemDetailVO){
|
||||
designItemDetails.forEach(d -> {
|
||||
if (!StringUtil.isNullOrEmpty(d.getColor())){
|
||||
PantoneVO pantoneByRgb = panToneService.getPantoneByRgb(d.getColor());
|
||||
DesignItemClothesDetailVO clothesDetailVO = designItemDetailVO.getClothes().stream()
|
||||
.filter(v -> v.getId().equals(d.getBusinessId()))
|
||||
.findFirst().orElse(null);
|
||||
if (Objects.nonNull(clothesDetailVO)){
|
||||
clothesDetailVO.setColor(pantoneByRgb);
|
||||
} else {
|
||||
DesignItemOthersDetailVO othersDetailVO = designItemDetailVO.getOthers().stream()
|
||||
.filter(v -> v.getId().equals(d.getBusinessId()))
|
||||
.findFirst().orElse(null);
|
||||
|
||||
if (Objects.nonNull(othersDetailVO)) {
|
||||
othersDetailVO.setColor(pantoneByRgb);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
return designItemDetailVO;
|
||||
}
|
||||
|
||||
|
||||
private DesignItemDetailVO editDesignItemLayer(Long designPythonOutfitId,DesignItemDetailVO designItemDetailVO){
|
||||
// 1、判断designPythonOutfitId查出的图层信息是否为空(不允许为空,系统内部错误)
|
||||
|
||||
// 2、将查询出的图层信息填充到designItemDetailVO中
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.ai.da.service.impl;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.ai.da.common.config.exception.BusinessException;
|
||||
import com.ai.da.common.utils.CopyUtil;
|
||||
import com.ai.da.mapper.entity.Collection;
|
||||
import com.ai.da.common.utils.PantoneUtils;
|
||||
import com.ai.da.mapper.entity.ColorLookupTable;
|
||||
import com.ai.da.mapper.entity.PanTone;
|
||||
import com.ai.da.mapper.PanToneMapper;
|
||||
@@ -15,17 +15,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -35,6 +30,8 @@ public class PanToneServiceImpl extends ServiceImpl<PanToneMapper, PanTone> impl
|
||||
@Resource
|
||||
private PanToneMapper panToneMapper;
|
||||
@Resource
|
||||
private PanToneService panToneService;
|
||||
@Resource
|
||||
private ColorLoopUpTableService colorLoopUpTableService;
|
||||
|
||||
@Override
|
||||
@@ -74,6 +71,49 @@ public class PanToneServiceImpl extends ServiceImpl<PanToneMapper, PanTone> impl
|
||||
return coverPanToneToVo(panTones);
|
||||
}
|
||||
|
||||
public Map<String,PantoneVO> getPantoneByRgbBatch(List<String> colors){
|
||||
|
||||
HashMap<Integer,String> colorValueRgb = new HashMap<>();
|
||||
HashMap<Integer,String> colorIndexRgb = new HashMap<>();
|
||||
ArrayList<Integer> values = new ArrayList<>();
|
||||
colors.forEach(color -> {
|
||||
int[] rgb = Arrays.stream(color.split("\\s+")).mapToInt(Integer::parseInt).toArray();
|
||||
int[] hsv = PantoneUtils.rgbToHsv(rgb);
|
||||
|
||||
int value = (hsv[0] * 101 *101)+ (hsv[1]*101) +hsv[2];
|
||||
colorValueRgb.put(value,color);
|
||||
values.add(value);
|
||||
});
|
||||
List<ColorLookupTable> colorValueList = colorLoopUpTableService.getByColorValueList(values);
|
||||
colorValueList.forEach(colorValue ->{
|
||||
colorIndexRgb.put(colorValue.getColorIndex(),colorValueRgb.get(colorValue.getColorValue()));
|
||||
});
|
||||
|
||||
List<PanTone> panTones = panToneService.listByIds(colorIndexRgb.values());
|
||||
ArrayList<PantoneVO> pantoneVOS = new ArrayList<>();
|
||||
panTones.forEach(panTone -> {
|
||||
pantoneVOS.add(coverPanToneToVo(panTone));
|
||||
});
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PantoneVO getPantoneByRgb(String color){
|
||||
GetRgbByHsvBatchDTO getRgbByHsvBatchDTO = new GetRgbByHsvBatchDTO();
|
||||
if (!StringUtil.isNullOrEmpty(color)){
|
||||
int[] rgb = Arrays.stream(color.split("\\s+")).mapToInt(Integer::parseInt).toArray();
|
||||
int[] hsv = PantoneUtils.rgbToHsv(rgb);
|
||||
|
||||
getRgbByHsvBatchDTO.setH(hsv[0]);
|
||||
getRgbByHsvBatchDTO.setS(hsv[1]);
|
||||
getRgbByHsvBatchDTO.setV(hsv[2]);
|
||||
}
|
||||
|
||||
return getByHSV(getRgbByHsvBatchDTO.getH(),getRgbByHsvBatchDTO.getS(),getRgbByHsvBatchDTO.getV());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PantoneVO> getRgbByHsvBatch(List<GetRgbByHsvBatchDTO> hsvBatch) {
|
||||
if(hsvBatch.size() >15){
|
||||
|
||||
47
src/main/resources/application-dev.properties
Normal file
47
src/main/resources/application-dev.properties
Normal file
@@ -0,0 +1,47 @@
|
||||
server.port=7766
|
||||
|
||||
#datasource
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
#spring.datasource.url=jdbc:mysql://18.167.251.121:33006/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=root
|
||||
|
||||
#security
|
||||
spring.security.jwtSecret=JWTSECRET
|
||||
spring.security.jwtTokenHeader=Authorization
|
||||
spring.security.jwtTokenPrefix=Bearer-
|
||||
## 24Сʱ
|
||||
spring.security.jwtExpiration=8640000000
|
||||
#spring security权限设置 认证了token还要认证权限 不然报错Full authentication is required to access this resource
|
||||
spring.security.ignorePaths=/,/favicon.ico,/doc.html,/webjars/**,/swagger-resources,/v2/api-docs,\
|
||||
/api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**,/api/generate/**
|
||||
spring.security.authApi=/auth/login
|
||||
|
||||
|
||||
rsa.private_key=MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
|
||||
|
||||
#mybatis
|
||||
mybatis-plus.global-config.banner=false
|
||||
mybatis-plus.mapper-locations=classpath:mapper/*Mapper.xml
|
||||
#mybatis-plus.configuration.log-impl= org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
|
||||
|
||||
file.mac.path=~/file/
|
||||
file.linux.path=/workspace/home/aida/file/
|
||||
#linux服务器域名(预览和下载用)
|
||||
#file.linuxDomain=http://18.162.111.141:5568/download/
|
||||
file.linuxDomain=http://18.167.251.121:5568/download/
|
||||
file.windows.path=D:\\upload\\
|
||||
|
||||
spring.servlet.multipart.max-file-size = 5MB
|
||||
spring.servlet.multipart.max-request-size= 5MB
|
||||
|
||||
#访问python服务的ip(对应环境)
|
||||
#access.python.ip=http://18.167.251.121
|
||||
access.python.ip=http://43.198.80.117
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.ai.da.mapper.entity.PanTone">
|
||||
<id column="id" property="id" />
|
||||
<result column="pantone_index" property="pantoneIndex" />
|
||||
<id column="pantone_index" property="pantoneIndex" />
|
||||
<result column="name" property="name" />
|
||||
<result column="tcx" property="tcx" />
|
||||
<result column="r" property="r" />
|
||||
|
||||
65
src/test/java/com/ai/da/controller/PantoneTest.java
Normal file
65
src/test/java/com/ai/da/controller/PantoneTest.java
Normal file
@@ -0,0 +1,65 @@
|
||||
package com.ai.da.controller;
|
||||
|
||||
import com.ai.da.AiDaApplication;
|
||||
import com.ai.da.common.utils.PantoneUtils;
|
||||
import com.ai.da.service.DesignService;
|
||||
import com.ai.da.service.PanToneService;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = AiDaApplication.class)
|
||||
public class PantoneTest {
|
||||
|
||||
@Resource
|
||||
private PanToneService panToneService;
|
||||
@Resource
|
||||
private DesignService designService;
|
||||
|
||||
@Test
|
||||
public void testGetPantoneByRgbBatch(){
|
||||
List<String> colors = Arrays.asList("244 222 222","120 57 55","229 208 207","223 184 182","80 49 48");
|
||||
// System.out.println(panToneService.getPantoneByRgbBatch(colors));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDesign(){
|
||||
System.out.println(designService.detail(34182L));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRgbToHsv(){
|
||||
|
||||
|
||||
// 42 228 194
|
||||
// 226 194 194
|
||||
// 174 226 20
|
||||
int[] rgb1 = {174,226,20};
|
||||
System.out.println(Arrays.toString(rgb1));
|
||||
rgb1 = PantoneUtils.rgbToHsv(rgb1);
|
||||
System.out.println(Arrays.toString(rgb1));
|
||||
System.out.println(rgb1[0] * 101 * 101 + rgb1[1] * 101 + rgb1[2]);
|
||||
int[] rgb2 = {226,194,194};
|
||||
System.out.println(Arrays.toString(rgb2));
|
||||
System.out.println(Arrays.toString(PantoneUtils.rgbToHsv(rgb2)));
|
||||
System.out.println(rgb2[0] * 101 * 101 + rgb2[1] * 101 + rgb2[2]);
|
||||
int[] rgb3 = {42,228,194};
|
||||
System.out.println(Arrays.toString(rgb3));
|
||||
System.out.println(Arrays.toString(PantoneUtils.rgbToHsv(rgb3)));
|
||||
System.out.println(rgb3[0] * 101 * 101 + rgb3[1] * 101 + rgb3[2]);
|
||||
|
||||
int[] rgb4 = {246,227,180};
|
||||
System.out.println(Arrays.toString(rgb4));
|
||||
rgb4 = PantoneUtils.rgbToHsv(rgb4);
|
||||
System.out.println(Arrays.toString(rgb4));
|
||||
System.out.println(rgb4[0] * 101 * 101 + rgb4[1] * 101 + rgb4[2]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user