Class ColorJsonConverter
- Assembly
- VisioForge.Core.dll
Converts Color through its ARGB bytes. The struct exposes only
read-only members, which IgnoreReadOnlyProperties drops - without this converter such a
colour is written as an empty object and cannot be restored.
public class ColorJsonConverter : JsonConverter<Color>Inheritance
Inherited Members
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type Color.
public override Color Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)Parameters
readerUtf8JsonReader-
The reader.
typeToConvertType-
The type to convert.
optionsJsonSerializerOptions-
An object that specifies serialization options to use.
Returns
- Color
-
The converted value.
Write(Utf8JsonWriter, Color, JsonSerializerOptions)
Writes a specified value as JSON.
public override void Write(Utf8JsonWriter writer, Color value, JsonSerializerOptions options)Parameters
writerUtf8JsonWriter-
The writer to write to.
valueColor-
The value to convert to JSON.
optionsJsonSerializerOptions-
An object that specifies serialization options to use.