原文: http://abujj.me/archives/695 Assuming you mean the HTML type RGB codes (called Hex codes, such as #FFCC66), use theColorTranslator class: System.Drawing.Color col = System.Drawing.ColorTranslator.FromHtml("#FFCC66"); If, however you are usin…
(1)方式一: Color color1 = (Color)System.Windows.Media.ColorConverter.ConvertFromString("#E0E0E0"); (2)方式二: Color color2 = ConvertToColor("#E0E0E0"); public static System.Windows.Media.Color ConvertToColor(string value) { int r = 0, g = 0,…