Luski.Net/Luski.net/Structures/Public/Color.cs

40 lines
623 B
C#
Raw Normal View History

using System;
namespace Luski.net.Structures.Public;
public class Color
{
public Color(string servercol)
{
2024-03-20 23:18:34 -04:00
Bytes = Convert.FromHexString(servercol);
}
public Color(byte R, byte G, byte B, byte A)
{
2024-03-20 23:18:34 -04:00
Bytes = new byte[] {R, G, B, A};
}
2024-03-20 23:18:34 -04:00
public string ToDatabaseStr()
{
2024-03-20 23:18:34 -04:00
return Convert.ToHexString(Bytes);
}
2024-03-20 23:18:34 -04:00
private byte[] Bytes;
public byte A
{
2024-03-20 23:18:34 -04:00
get => Bytes[3];
}
public byte R
{
2024-03-20 23:18:34 -04:00
get => Bytes[0];
}
public byte G
{
2024-03-20 23:18:34 -04:00
get => Bytes[1];
}
public byte B
{
2024-03-20 23:18:34 -04:00
get => Bytes[2];
}
}