How do I convert a color to integer and vice-versa?

Platform: WinForms| Category: Colors

You can do it using the FromArgb and ToArgb methods as follows:


// from Color to int
int blueInt = Color.Blue.ToArgb( );

// from int to Color
Color newColor = Color.FromArgb( blueInt );

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.