Fixed bug in COLORREF when setting from a Color.

pull/133/head
dahall 2020-06-09 19:00:23 -06:00
parent acdb6f845b
commit e5c9d02a3b
1 changed files with 5 additions and 1 deletions

View File

@ -51,7 +51,11 @@ namespace Vanara.PInvoke
/// <summary>Initializes a new instance of the <see cref="COLORREF"/> struct.</summary>
/// <param name="color">The color.</param>
public COLORREF(System.Drawing.Color color) : this(color == System.Drawing.Color.Transparent ? CLR_NONE : (uint)color.ToArgb()) { }
public COLORREF(System.Drawing.Color color) : this(color.R, color.G, color.B)
{
if (color == System.Drawing.Color.Transparent)
Value = CLR_NONE;
}
/// <summary>Performs an implicit conversion from <see cref="COLORREF"/> to <see cref="System.Drawing.Color"/>.</summary>
/// <param name="cr">The <see cref="COLORREF"/> value.</param>