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

40 lines
658 B
C#

using System;
namespace Luski.net.Structures.Public;
public class Color
{
public Color(string servercol)
{
Bytes = servercol;
}
public Color(byte R, byte G, byte B, byte A)
{
Bytes = $"{Convert.ToChar(R)}{Convert.ToChar(G)}{Convert.ToChar(B)}{Convert.ToChar(A)}";
}
private string Bytes;
public string ToDB()
{
return Bytes;
}
public byte A
{
get => (byte)(Bytes[3]);
}
public byte R
{
get => (byte)(Bytes[0]);
}
public byte G
{
get => (byte)(Bytes[1]);
}
public byte B
{
get => (byte)(Bytes[2]);
}
}