/// <summary>
/// 取System.Drawing.Color定义的颜色
/// </summary>
/// <param name="index">index</param>
/// <returns>string</returns>
public static string GetColorList(int index)
{
Type colorType = typeof(Color);
PropertyInfo[] info = colorType.GetProperties();
List<string> colorList = new List<string>();
for (int i = 0; i < info.Length; i++)
{
if (info[i].PropertyType.ToString() == "System.Drawing.Color")
{
if(info[i].Name != "Transparent")
colorList.Add(info[i].Name);
}
}
if (index >= colorList.Count)
{
index = index % colorList.Count;
}
return colorList[index];
}