Added shared UI library and finished the ColorPicker

This commit is contained in:
Robert committed 2019-12-09 19:25:45 +01:00
1 parent 515348241a
commit cec6fb45dc
30 files changed
+875 -321

No files matched your search

@@ -0,0 +1,24 @@
using System;
using Newtonsoft.Json;
using SkiaSharp;
namespace Artemis.Core.JsonConverters
{
public class SKColorConverter : JsonConverter<SKColor>
{
public override void WriteJson(JsonWriter writer, SKColor value, JsonSerializer serializer)
{
writer.WriteValue(value.ToString());
}
public override SKColor ReadJson(JsonReader reader, Type objectType, SKColor existingValue, bool hasExistingValue, JsonSerializer serializer)
{
if (reader.Value is string value && !string.IsNullOrWhiteSpace(value))
{
return SKColor.Parse(value);
}
return SKColor.Empty;
}
}
}