Search in sources :

Example 6 with ColorData

use of com.bwssystems.HABridge.hue.ColorData in project ha-bridge by bwssytems.

the class ConvertCIEColorTestCase method testColorConversionXYtoRGB2.

@Test
public void testColorConversionXYtoRGB2() {
    ArrayList<Double> xy = new ArrayList<Double>(Arrays.asList(Double.parseDouble("0.32312"), Double.parseDouble("0.15539")));
    List<Integer> colorDecode = ColorDecode.convertCIEtoRGB(xy, 59);
    List<Integer> assertDecode = new ArrayList<Integer>();
    assertDecode.add(0, 233);
    assertDecode.add(1, 0);
    assertDecode.add(2, 231);
    Assert.assertEquals(colorDecode, assertDecode);
    ColorData colorData = new ColorData(ColorData.ColorMode.XY, xy);
    int rgbIntVal = ColorDecode.getIntRGB(colorData, 59);
    Assert.assertEquals(rgbIntVal, 15270119);
}
Also used : ColorData(com.bwssystems.HABridge.hue.ColorData) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

ColorData (com.bwssystems.HABridge.hue.ColorData)6 DeviceState (com.bwssystems.HABridge.api.hue.DeviceState)3 HueError (com.bwssystems.HABridge.api.hue.HueError)3 StateChangeBody (com.bwssystems.HABridge.api.hue.StateChangeBody)3 JsonSyntaxException (com.google.gson.JsonSyntaxException)3 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 DeviceResponse (com.bwssystems.HABridge.api.hue.DeviceResponse)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1