I have serialized System.Drawing.Color in JSON using JavaScriptSerializer, but when i try to de-serialize it, it returns Color object with All the values 0.
Sample JSON is as below.
{
"A":255,
"B":0,
"G":165,
"IsEmpty":false,
"IsKnownColor":true,
"IsNamedColor":true,
"IsSystemColor":false,
"Name":"Orange",
"R":255
}
Here is the screen shot of how deserialized object looks like.
Then i tried using JSON.net(newtonsoft.json) library. It gives me below error.
Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Drawing.Color' because the type requires a JSON string value to deserialize correctly.
Is there any way of deserialzing JSON to color object.i have found this similar question without any answere.