private Color ReturnColorFromString(string color)
{
string alpha = color.Substring(0, 2);
string red = color.Substring(2, 2);
string green = color.Substring(4, 2);
string blue = color.Substring(6, 2);
byte alphaByte = Convert.ToByte(alpha, 16);
byte redByte = Convert.ToByte(red, 16);
byte greenByte = Convert.ToByte(green, 16);
byte blueByte = Convert.ToByte(blue, 16);
return Color.FromArgb(alphaByte, redByte, greenByte, blueByte);
}
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12639172/viewspace-630293/
,如需转载,请注明出处,否则将追究法律责任。