Table of Contents

ColorHexJsonConverter 类

命名空间
ClassIsland.Core.Converters
程序集
ClassIsland.Core.dll

适用于 Avalonia.Media.Color 的值转换器。

public class ColorHexJsonConverter : JsonConverter<Color>
继承
ColorHexJsonConverter
继承成员

方法

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts the JSON to type Avalonia.Media.Color.

public override Color Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

参数

reader Utf8JsonReader

The reader.

typeToConvert Type

The type to convert.

options JsonSerializerOptions

An object that specifies serialization options to use.

返回

Color

The converted value.

Write(Utf8JsonWriter, Color, JsonSerializerOptions)

Writes a specified value as JSON.

public override void Write(Utf8JsonWriter writer, Color value, JsonSerializerOptions options)

参数

writer Utf8JsonWriter

The writer to write to.

value Color

The value to convert to JSON.

options JsonSerializerOptions

An object that specifies serialization options to use.