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 );