Lean  $LEAN_TAG$
QuantConnect.Util.ColorJsonConverter Class Reference

A JsonConverter implementation that serializes a Color as a string. If Color is empty, string is also empty and vice-versa. Meaning that color is autogen. More...

Inheritance diagram for QuantConnect.Util.ColorJsonConverter:
[legend]

Protected Member Functions

override string Convert (Color value)
 Converts a .NET Color to a hexadecimal as a string More...
 
override Color Convert (string value)
 Converts the input string to a .NET Color object More...
 
- Protected Member Functions inherited from QuantConnect.Util.TypeChangeJsonConverter< Color, string >
virtual T Create (Type type, JToken token)
 Creates an instance of the un-projected type to be deserialized More...
 
abstract TResult Convert (T value)
 Convert the input value to a value to be serialized More...
 
abstract T Convert (TResult value)
 Converts the input value to be deserialized More...
 

Additional Inherited Members

- Public Member Functions inherited from QuantConnect.Util.TypeChangeJsonConverter< Color, string >
override object ReadJson (JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
 Reads the JSON representation of the object. More...
 
override void WriteJson (JsonWriter writer, object value, JsonSerializer serializer)
 Writes the JSON representation of the object. More...
 
override bool CanConvert (Type objectType)
 Determines whether this instance can convert the specified object type. More...
 
- Protected Attributes inherited from QuantConnect.Util.TypeChangeJsonConverter< Color, string >
virtual bool PopulateProperties
 True will populate TResult object returned by Convert(TResult) with json properties More...
 

Detailed Description

A JsonConverter implementation that serializes a Color as a string. If Color is empty, string is also empty and vice-versa. Meaning that color is autogen.

Definition at line 28 of file ColorJsonConverter.cs.

Member Function Documentation

◆ Convert() [1/2]

override string QuantConnect.Util.ColorJsonConverter.Convert ( Color  value)
protected

Converts a .NET Color to a hexadecimal as a string

Parameters
valueThe input value to be converted before serialization
Returns
Hexadecimal number as a string. If .NET Color is null, returns default #000000

Definition at line 35 of file ColorJsonConverter.cs.

◆ Convert() [2/2]

override Color QuantConnect.Util.ColorJsonConverter.Convert ( string  value)
protected

Converts the input string to a .NET Color object

Parameters
valueThe deserialized value that needs to be converted to T
Returns
The converted value

Definition at line 45 of file ColorJsonConverter.cs.


The documentation for this class was generated from the following file: