mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Added shared UI library and finished the ColorPicker
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user