AndroidScript AndroidScript - 5 months ago 56
C# Question

Saving a Color to a file (Visual C#)

I am currently working on a program that lets the user save and edit Strings and other Variables, among others colors. Now, I want the user to be able to save all data in the form to a file, but that's not the problem. Is there any way to save the color from a ColorPickerDialog (colorPickerDialog1.Color) to a file? I tried converting it into a string and saving that, but I have no idea how to convert the String back into a color. (I am only using the named colors)


See Color.FromArgb and Color.ToArgb. Those will convert Color objects to/from 32-bit integer values, which you can of course convert to/from string values.