Converting System.Drawing.Color to hex

added by DotNetKicks
8/11/2017 11:48:38 AM

573 Views

One quick code note to make during building my Azure Cognitive Services demo application. I needed a way how to convert colors of System.Drawing to hex strings that I can use in views. Here is my simple and elegant solution. To convert Color to hexadecimal string we can use ColorTranslator class from System.Drawing namespace.


0 comments