Updated GenerateMask helper

This commit is contained in:
Misaki
2025-01-23 23:56:11 +09:00
parent b00b63cfb4
commit eb6c2d9e54
16 changed files with 503 additions and 232 deletions

View File

@@ -1,10 +1,31 @@
namespace Misaki.ArtToolEditor
using System;
namespace Misaki.ArtToolEditor
{
internal enum TextureChannel
{
None,
R,
G,
B,
A
}
internal static class TextureChannelHelpers
{
private static readonly ArgumentException _channelNoneException = new("Channel is none");
public static int ToColorIndex(this TextureChannel channel)
{
return channel switch
{
TextureChannel.None => throw _channelNoneException,
TextureChannel.R => 0,
TextureChannel.G => 1,
TextureChannel.B => 2,
TextureChannel.A => 3,
_ => throw _channelNoneException
};
}
}
}