Updated GenerateMask helper
This commit is contained in:
@@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user