diff --git a/MuzikaGromche/Plugin.cs b/MuzikaGromche/Plugin.cs index 86aeedf..0ffe420 100644 --- a/MuzikaGromche/Plugin.cs +++ b/MuzikaGromche/Plugin.cs @@ -263,6 +263,28 @@ namespace MuzikaGromche } return new Palette(colors); } + + public static Palette operator +(Palette before, Palette after) + { + return new Palette([.. before.Colors, .. after.Colors]); + } + + public static Palette operator *(Palette palette, int repeat) + { + var colors = Enumerable.Repeat(palette.Colors, repeat).SelectMany(x => x).ToArray(); + return new Palette(colors); + } + + public Palette Stretch(int times) + { + var colors = Colors.SelectMany(color => Enumerable.Repeat(color, times)).ToArray(); + return new Palette(colors); + } + + public Palette Use(Func op) + { + return op.Invoke(this); + } } public class Track