mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-19 16:06:35 +08:00
feat: Add Dark/Light color palette.
This commit is contained in:
29
src/Semi.Avalonia.ColorPicker/SemiColorLightPalette.cs
Normal file
29
src/Semi.Avalonia.ColorPicker/SemiColorLightPalette.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Utilities;
|
||||
|
||||
namespace Semi.Avalonia.ColorPicker;
|
||||
|
||||
public class SemiColorLightPalette: IColorPalette
|
||||
{
|
||||
private static readonly Color[,] Colors = new Color[,]
|
||||
{
|
||||
{
|
||||
Color.FromUInt32(0xFFFEF2ED),
|
||||
},
|
||||
{
|
||||
Color.FromUInt32(0xFFFEF2ED),
|
||||
}
|
||||
};
|
||||
public Color GetColor(int colorIndex, int shadeIndex)
|
||||
{
|
||||
return Colors[
|
||||
MathUtilities.Clamp(colorIndex, 0, ColorCount - 1),
|
||||
MathUtilities.Clamp(shadeIndex, 0, ShadeCount - 1)
|
||||
];
|
||||
}
|
||||
|
||||
public int ColorCount => Colors.GetLength(0);
|
||||
|
||||
public int ShadeCount => Colors.GetLength(1);
|
||||
}
|
||||
Reference in New Issue
Block a user