40 lines
623 B
C#
40 lines
623 B
C#
using System;
|
|
|
|
namespace Luski.net.Structures.Public;
|
|
|
|
public class Color
|
|
{
|
|
public Color(string servercol)
|
|
{
|
|
Bytes = Convert.FromHexString(servercol);
|
|
}
|
|
|
|
public Color(byte R, byte G, byte B, byte A)
|
|
{
|
|
Bytes = new byte[] {R, G, B, A};
|
|
}
|
|
|
|
public string ToDatabaseStr()
|
|
{
|
|
return Convert.ToHexString(Bytes);
|
|
}
|
|
|
|
private byte[] Bytes;
|
|
|
|
public byte A
|
|
{
|
|
get => Bytes[3];
|
|
}
|
|
public byte R
|
|
{
|
|
get => Bytes[0];
|
|
}
|
|
public byte G
|
|
{
|
|
get => Bytes[1];
|
|
}
|
|
public byte B
|
|
{
|
|
get => Bytes[2];
|
|
}
|
|
} |