Search in sources :

Example 1 with ColorCombinaison

use of org.asqatasun.contrastFinder.result.ColorCombinaison in project Contrast-Finder by Asqatasun.

the class ColorFinderHsvTest method testFindColorsBornWhite2.

public void testFindColorsBornWhite2() {
    System.out.println("FindColorsBornWhite2");
    Color foregroundColor = new Color(254, 254, 254);
    Color backgroundColor = new Color(255, 255, 255);
    Float coefficientLevel = 4.5f;
    ColorFinderHsv instance = new ColorFinderHsv();
    List<ColorCombinaison> colorCombinaison = new ArrayList<ColorCombinaison>();
    instance.findColors(foregroundColor, backgroundColor, false, coefficientLevel);
    for (ColorCombinaison combinaisons : instance.getColorResult().getSuggestedColors()) {
        LOGGER.debug("HashCode :" + colorCombinaison.hashCode() + "    COLOR : " + combinaisons.getContrast());
        colorCombinaison.add(combinaisons);
    }
    int sizeList = colorCombinaison.size();
    Color firstColor = new Color(104, 104, 104);
    assertEquals(firstColor, colorCombinaison.get(0).getColor());
    Color mediumColor = new Color(154, 93, 93);
    assertEquals(mediumColor, colorCombinaison.get(4).getColor());
    Color endColor = new Color(229, 4, 4);
    assertEquals(endColor, colorCombinaison.get(sizeList - 1).getColor());
}
Also used : ColorCombinaison(org.asqatasun.contrastFinder.result.ColorCombinaison) Color(java.awt.Color) ArrayList(java.util.ArrayList)

Example 2 with ColorCombinaison

use of org.asqatasun.contrastFinder.result.ColorCombinaison in project Contrast-Finder by Asqatasun.

the class ColorFinderHsvTest method testFindColorsBornBlack2.

public void testFindColorsBornBlack2() {
    System.out.println("FindColorsBornBlack2");
    Color foregroundColor = new Color(1, 1, 1);
    Color backgroundColor = new Color(3, 3, 3);
    Float coefficientLevel = 4.5f;
    ColorFinderHsv instance = new ColorFinderHsv();
    List<ColorCombinaison> colorCombinaison = new ArrayList<ColorCombinaison>();
    instance.findColors(foregroundColor, backgroundColor, false, coefficientLevel);
    for (ColorCombinaison combinaisons : instance.getColorResult().getSuggestedColors()) {
        LOGGER.debug("HashCode :" + colorCombinaison.hashCode() + "    COLOR : " + combinaisons.getContrast());
        colorCombinaison.add(combinaisons);
    }
    Color firstColor = new Color(131, 131, 131);
    assertEquals(firstColor, colorCombinaison.get(0).getColor());
}
Also used : ColorCombinaison(org.asqatasun.contrastFinder.result.ColorCombinaison) Color(java.awt.Color) ArrayList(java.util.ArrayList)

Example 3 with ColorCombinaison

use of org.asqatasun.contrastFinder.result.ColorCombinaison in project Contrast-Finder by Asqatasun.

the class ColorFinderHsvTest method testFindColorsBornBlack.

public void testFindColorsBornBlack() {
    System.out.println("FindColorsBornBlack");
    Color foregroundColor = new Color(1, 1, 1);
    Color backgroundColor = new Color(3, 3, 3);
    Float coefficientLevel = 4.5f;
    ColorFinderHsv instance = new ColorFinderHsv();
    List<ColorCombinaison> colorCombinaison = new ArrayList<ColorCombinaison>();
    instance.findColors(foregroundColor, backgroundColor, true, coefficientLevel);
    for (ColorCombinaison combinaisons : instance.getColorResult().getSuggestedColors()) {
        LOGGER.debug("HashCode :" + colorCombinaison.hashCode() + "    COLOR : " + combinaisons.getContrast());
        colorCombinaison.add(combinaisons);
    }
    Color firstColor = new Color(133, 133, 133);
    assertEquals(firstColor, colorCombinaison.get(0).getColor());
}
Also used : ColorCombinaison(org.asqatasun.contrastFinder.result.ColorCombinaison) Color(java.awt.Color) ArrayList(java.util.ArrayList)

Example 4 with ColorCombinaison

use of org.asqatasun.contrastFinder.result.ColorCombinaison in project Contrast-Finder by Asqatasun.

the class ColorFinderHsvTest method testFindColorsBornBlack2.

@Test
public void testFindColorsBornBlack2() {
    System.out.println("FindColorsBornBlack2");
    Color foregroundColor = new Color(1, 1, 1);
    Color backgroundColor = new Color(3, 3, 3);
    Float coefficientLevel = 4.5f;
    ColorFinderHsv instance = new ColorFinderHsv();
    List<ColorCombinaison> colorCombinaison = new ArrayList<ColorCombinaison>();
    instance.findColors(foregroundColor, backgroundColor, false, coefficientLevel);
    for (ColorCombinaison combinaisons : instance.getColorResult().getSuggestedColors()) {
        LOGGER.debug("HashCode :" + colorCombinaison.hashCode() + "    COLOR : " + combinaisons.getContrast());
        colorCombinaison.add(combinaisons);
    }
    Color firstColor = new Color(131, 131, 131);
    assertEquals(firstColor, colorCombinaison.get(0).getColor());
}
Also used : ColorCombinaison(org.asqatasun.contrastfinder.result.ColorCombinaison) Color(java.awt.Color) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 5 with ColorCombinaison

use of org.asqatasun.contrastFinder.result.ColorCombinaison in project Contrast-Finder by Asqatasun.

the class ColorFinderHsvTest method testFindColorsBornWhite.

@Test
public void testFindColorsBornWhite() {
    System.out.println("FindColorsBornWhite");
    Color foregroundColor = new Color(254, 254, 254);
    Color backgroundColor = new Color(255, 255, 255);
    Float coefficientLevel = 4.5f;
    ColorFinderHsv instance = new ColorFinderHsv();
    List<ColorCombinaison> colorCombinaison = new ArrayList<ColorCombinaison>();
    instance.findColors(foregroundColor, backgroundColor, true, coefficientLevel);
    for (ColorCombinaison combinaisons : instance.getColorResult().getSuggestedColors()) {
        LOGGER.debug("HashCode :" + colorCombinaison.hashCode() + "    COLOR : " + combinaisons.getContrast());
        colorCombinaison.add(combinaisons);
    }
    int sizeList = colorCombinaison.size();
    Color firstColor = new Color(105, 105, 105);
    assertEquals(firstColor, colorCombinaison.get(0).getColor());
    Color mediumColor = new Color(155, 94, 94);
    assertEquals(mediumColor, colorCombinaison.get(4).getColor());
    Color endColor = new Color(230, 1, 1);
    assertEquals(endColor, colorCombinaison.get(sizeList - 1).getColor());
}
Also used : ColorCombinaison(org.asqatasun.contrastfinder.result.ColorCombinaison) Color(java.awt.Color) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

Color (java.awt.Color)28 ArrayList (java.util.ArrayList)24 ColorCombinaison (org.asqatasun.contrastFinder.result.ColorCombinaison)15 ColorCombinaison (org.asqatasun.contrastfinder.result.ColorCombinaison)15 Test (org.junit.Test)12