2023-08-21 10:58:17 -04:00
|
|
|
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);
|
2023-08-21 10:58:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
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};
|
2023-08-21 10:58:17 -04:00
|
|
|
}
|
|
|
|
|
2024-03-20 23:18:34 -04:00
|
|
|
public string ToDatabaseStr()
|
2023-08-21 10:58:17 -04:00
|
|
|
{
|
2024-03-20 23:18:34 -04:00
|
|
|
return Convert.ToHexString(Bytes);
|
2023-08-21 10:58:17 -04:00
|
|
|
}
|
2024-03-20 23:18:34 -04:00
|
|
|
|
|
|
|
private byte[] Bytes;
|
2023-08-21 10:58:17 -04:00
|
|
|
|
|
|
|
public byte A
|
|
|
|
{
|
2024-03-20 23:18:34 -04:00
|
|
|
get => Bytes[3];
|
2023-08-21 10:58:17 -04:00
|
|
|
}
|
|
|
|
public byte R
|
|
|
|
{
|
2024-03-20 23:18:34 -04:00
|
|
|
get => Bytes[0];
|
2023-08-21 10:58:17 -04:00
|
|
|
}
|
|
|
|
public byte G
|
|
|
|
{
|
2024-03-20 23:18:34 -04:00
|
|
|
get => Bytes[1];
|
2023-08-21 10:58:17 -04:00
|
|
|
}
|
|
|
|
public byte B
|
|
|
|
{
|
2024-03-20 23:18:34 -04:00
|
|
|
get => Bytes[2];
|
2023-08-21 10:58:17 -04:00
|
|
|
}
|
|
|
|
}
|