design detail代码转移,临时存储
This commit is contained in:
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