纳金网
标题:
16进制颜色值转rgb
[打印本页]
作者:
may
时间:
2015-12-29 06:08
标题:
16进制颜色值转rgb
rgb = "FFFFFF";
var result = Regex.Matches(rgb, @"\w{2}");
List<string> re = new List<string>();
foreach (Match item in result)
{
re.Add(item.Value);
}
byte r = (byte)Convert.ToByte(re[0], 16);
byte g = (byte)Convert.ToByte(re[1], 16);
byte b = (byte)Convert.ToByte(re[2], 16);
Color32 color = new Color32(r, g, b, 255);
欢迎光临 纳金网 (http://go.narkii.com/club/)
Powered by Discuz! X2.5