How can I get Color
from hex value in ASP.NET Core?
I found Color
class in System.Drawing
namespace, but no appropriate method FromHex
.
I need to convert values like:
#F3A
#2F3682
#83A7B278
I found that corefx contains System.Drawing.Common, so you can use
Color col = ColorTranslator.FromHtml("#FFCC66");
Source code can be found here: GitHub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With