-
Notifications
You must be signed in to change notification settings - Fork 6.6k
/
ColorPickerPropertiesVersion1.cs
59 lines (46 loc) · 2.14 KB
/
ColorPickerPropertiesVersion1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.PowerToys.Settings.UI.Library.Enumerations;
namespace Microsoft.PowerToys.Settings.UI.Library
{
public class ColorPickerPropertiesVersion1
{
public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x43);
public ColorPickerPropertiesVersion1()
{
ActivationShortcut = DefaultActivationShortcut;
ChangeCursor = false;
ColorHistory = new List<string>();
ColorHistoryLimit = 20;
VisibleColorFormats = new Dictionary<string, bool>();
VisibleColorFormats.Add("HEX", true);
VisibleColorFormats.Add("RGB", true);
VisibleColorFormats.Add("HSL", true);
ShowColorName = false;
ActivationAction = ColorPickerActivationAction.OpenColorPickerAndThenEditor;
}
public HotkeySettings ActivationShortcut { get; set; }
[JsonPropertyName("changecursor")]
[JsonConverter(typeof(BoolPropertyJsonConverter))]
public bool ChangeCursor { get; set; }
[JsonPropertyName("copiedcolorrepresentation")]
public ColorRepresentationType CopiedColorRepresentation { get; set; }
[JsonPropertyName("activationaction")]
public ColorPickerActivationAction ActivationAction { get; set; }
[JsonPropertyName("colorhistory")]
public List<string> ColorHistory { get; set; }
[JsonPropertyName("colorhistorylimit")]
public int ColorHistoryLimit { get; set; }
[JsonPropertyName("visiblecolorformats")]
public Dictionary<string, bool> VisibleColorFormats { get; set; }
[JsonPropertyName("showcolorname")]
[JsonConverter(typeof(BoolPropertyJsonConverter))]
public bool ShowColorName { get; set; }
public override string ToString()
=> JsonSerializer.Serialize(this);
}
}