public void SetMotherboardColors(int handle, LedColor[] colors) { byte[] bytes = new byte[colors.Length * 3]; for (int i = 0; i < bytes.Length; i += 3) { LedColor color = colors[i / 3]; bytes[i] = color.Red; bytes[i + 1] = color.Green; bytes[i + 2] = color.Blue; } impl.SetMotherboardColors(handle, bytes); }
public LedColor[] GetMotherboardColors(int handle) { byte[] bytes = impl.GetMotherboardColors(handle); LedColor[] colors = new LedColor[bytes.Length / 3]; for (int i = 0; i < bytes.Length; i += 3) { LedColor color = new LedColor(); color.Red = bytes[i]; color.Green = bytes[i + 1]; color.Blue = bytes[i + 2]; colors[i / 3] = color; } return(colors); }