This project has moved and is read-only. For the latest updates, please go here.

How to use RGB colors

Jan 15, 2011 at 12:30 PM
Edited Jan 15, 2011 at 3:35 PM


Is there a way to use RGB colors rather than named colors?

your library is very simple to use and works great. thanks for this awesome library.


Prasun Bheri

Jan 15, 2011 at 4:45 PM


If you have the ARGB value you can use one of the following:

XLColor.FromArgb(Int32 argb)
XLColor.FromArgb(Int32 a, Int32 r, Int32 g, Int32 b)
XLColor.FromArgb(Int32 r, Int32 g, Int32 b)

If you have the System.Drawing.Color you can just feed it to XLColor:

XLColor.FromColor(Color color)

You can also use a Hex value if you have it:

XLColor.FromHtml(String htmlColor)


I'll update the "Using Colors" page in the documentation to make this more explicit.


Jan 15, 2011 at 5:29 PM

thanks for quick reply.

also wondering, is there a way to create graphs/charts using ClosedXML?


Jan 15, 2011 at 5:40 PM

Not yet, I'm going to implement hyperlinks (shouldn't take long), and then tackle graphs/charts. It should take anywhere between 1 and 3 months.

Jan 15, 2011 at 5:50 PM

cool.. keep up the great work..