Example #1
0
		protected NSColor GetLightColor (Light light)
		{
			var color = ColorService.RGBFromXY (light.state.xy);
			return NSColor.FromDeviceRgba (color [0] / 255.0f,
			                               color [1] / 255.0f,
			                               color [2] / 255.0f, 1.0f);
		}
Example #2
0
		protected void CreateLight(string id, Light light)
		{
			var newLight = new LightModel {
				Id = id,
				Name = light.name,
				Brightness = light.state.bri,
				Enabled = light.state.on,
				Color = GetLightColor(light),
			};
			
			newLight.PropertyChanged += OnLightChanged;
			
			Controller.AddObject (newLight);
			Storage[id] = newLight;
		}