Convert MS Access Color Code to Hex in C#

.net, asp.net, c#, ms-access

Solution

You can convert to hex like so:

 string hexValue = "#" + 16777215.ToString("X");

Or wrap it up in a method:

 public static string AccessToHex(int colorCode) {
      return "#" + colorCode.ToString("X");
 }

Problem

Is there a method to convert MS Access Color codes to Hex in C#? ``` e.g. - (white) 16777215 -> #FFFFFF - (black) 0 -> #000000 - (blue) 16711680 -> #0000FF ``` Here are some reference tables I found on stackoverflow - http://www.endprod.com/colors/invcol.htm - http://cloford.com/resources/colours/500col.htm

Original source