mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
UI - Added gradient editor dialog
This commit is contained in:
1 parent
0a5f16a0f4
commit
2aec2ab000
19 files changed
+1485
-117
No files matched your search
@@ -1,17 +1,50 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Artemis.Core.Annotations;
|
||||
using PropertyChanged;
|
||||
using SkiaSharp;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.Core.Models.Profile
|
||||
{
|
||||
public class ColorGradient
|
||||
[DoNotNotify]
|
||||
public class ColorGradient : INotifyPropertyChanged
|
||||
{
|
||||
private float _rotation;
|
||||
|
||||
public ColorGradient()
|
||||
{
|
||||
Colors = new List<ColorGradientColor>();
|
||||
Colors = new BindableCollection<ColorGradientColor>();
|
||||
}
|
||||
|
||||
public List<ColorGradientColor> Colors { get; }
|
||||
public float Rotation { get; set; }
|
||||
public BindableCollection<ColorGradientColor> Colors { get; }
|
||||
|
||||
public float Rotation
|
||||
{
|
||||
get => _rotation;
|
||||
set
|
||||
{
|
||||
if (_rotation != value)
|
||||
{
|
||||
_rotation = value;
|
||||
OnPropertyChanged(nameof(Rotation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
public SKColor[] GetColorsArray()
|
||||
{
|
||||
return Colors.Select(c => c.Color).ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public struct ColorGradientColor
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user