public static Color ToColor(this ServerColor color) { if (color != null) { return new Color() { R = (byte)color.Red, G = (byte)color.Green, B = (byte)color.Blue, A = 255 }; } //如果传入的ServerColor是null,则返回透明; return Color.FromArgb(0, 0, 0, 0); }