测试代码删除

This commit is contained in:
xupei
2023-09-07 15:43:50 +08:00
parent 165449084b
commit 5d482365cd

View File

@@ -4,6 +4,7 @@ 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 com.alibaba.fastjson.JSONObject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
@@ -17,49 +18,5 @@ import java.util.List;
@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]);
}
}