1、Color.FromArgb(120,243,244,247)
先将F3,F4,F7转化为十进制数,再调用以上方法。
2、把F3 F4 F7转成10进制
然后用 Color.FromArgb
3、Color yourColor = Color.FromName("#F3F4F7");
4、比较笨一点的办法:
string a="#F3F4F7";
new System.Drawing.Color.fromArgb(
System.int8.parse(a.substring(1,2),System.Globalization.NumberStyles.AllowHexSpecifier);
System.int8.parse(a.substring(3,2),System.Globalization.NumberStyles.AllowHexSpecifier);
System.int8.parse(a.substring(5,2),System.Globalization.NumberStyles.AllowHexSpecifier);
);
5、Color color =Color.FromArgb(0xf3,0xf4,0xf7);
6、Public ForeColor As System.Drawing.Color = ColorTranslator.FromHtml("#F3F4F7")
7、System.Drawing.ColorConverter cc=new System.Drawing.ColorConverter();
return (System.Drawing.Color)cc.ConvertFromString(sHex);
drawing
方法
字符串
system
字符