32 lines
739 B
C#
32 lines
739 B
C#
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
|
|
};
|
|
}
|
|
}
|
|
}
|