public static LightCommand SetColor(this LightCommand lightCommand, RGBColor color, string model = "LCT001")
        {
            if (lightCommand == null)
            {
                throw new ArgumentNullException(nameof(lightCommand));
            }

            var point = HueColorConverter.RgbToXY(color, model);

            return(lightCommand.SetColor(point.x, point.y));
        }
예제 #2
0
 public static RGBColor ToRgb(this State state, string model = "LCT001")
 {
     return(HueColorConverter.RgbFromState(state, model));
 }
예제 #3
0
 public static string ToHex(this State state, string model = "LCT001")
 {
     return(HueColorConverter.HexFromState(state, model));
 }
예제 #4
0
 public static string ToHex(this Light light)
 {
     return(HueColorConverter.HexFromState(light.State, light.ModelId));
 }