From 9dfef636bdd3820083753321b021d927ddc2ab61 Mon Sep 17 00:00:00 2001 From: RogueException Date: Thu, 15 Oct 2015 17:43:25 -0300 Subject: [PATCH] Added rgb constructors for PackedColor --- src/Discord.Net/Models/PackedColor.cs | 2 ++ 1 file changed, 2 insertions(+) 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); } }