public void GetCurrentConfig(ref List <Color> colours, out ushort stepDuration, out bool breathingEnabled, out bool invertedRChannel, out bool invertedGChannel, out bool invertedBChannel, out FlashingSpeed flashingSpeed) { foreach (byte index in Range(1, 8)) { Color c = _lighting.GetColour(index).Value; c.R *= 0x11; // Colour is exposed as 12-bit depth, but colour picker expects 24-bit depth c.G *= 0x11; c.B *= 0x11; colours.Add(c); } stepDuration = _lighting.GetStepDuration(); breathingEnabled = _lighting.IsBreathingModeEnabled(); invertedRChannel = _lighting.IsRChannelInverted(); invertedGChannel = _lighting.IsGChannelInverted(); invertedBChannel = _lighting.IsBChannelInverted(); flashingSpeed = (FlashingSpeed)_lighting.GetFlashingSpeed(); }
public DynValue GetColour(byte index) { if (index < 1 || index > 8) { throw ScriptRuntimeException.BadArgumentIndexOutOfRange("GetColour", 0); } Color c = _lighting.GetColour(index).Value; return(DynValue.NewTuple(new DynValue[] { DynValue.NewNumber(c.R), DynValue.NewNumber(c.G), DynValue.NewNumber(c.B) })); }