diff --git a/src/Discord.Net/Models/PackedColor.cs b/src/Discord.Net/Models/PackedColor.cs index 421fc9b7d..c6da6314d 100644 --- a/src/Discord.Net/Models/PackedColor.cs +++ b/src/Discord.Net/Models/PackedColor.cs @@ -49,6 +49,8 @@ namespace Discord } public PackedColor(uint rawValue) { _rawValue = rawValue; } + public PackedColor(byte r, byte g, byte b) : this(((uint)r << 16) | ((uint)g << 8) | b) { } + public PackedColor(float r, float g, float b) : this((byte)(r * 255.0f), (byte)(g * 255.0f), (byte)(b * 255.0f)) { } /// Gets or sets the red component for this color. public byte R { get { return GetByte(3); } set { SetByte(3, value); } }