diogotr7 / OpenRGB.NET

C# client for the OpenRGB SDK
MIT License
40 stars 16 forks source link

Explicit default constructor for Color #22

Closed wfowler1 closed 1 year ago

wfowler1 commented 2 years ago

Currently the Color class includes the constructor public Color(byte red = 0, byte green = 0, byte blue = 0) This works fine for writing code, but I recently ran into a case where I needed to use Activator.CreateInstance to construct a new object which might be a Color. Since this constructor isn't parameterless, it's not seen as a default constructor. I can't use one of the overloads of CreateInstance that allows me to pass parameters because I don't know at compile-time whether it's a Color or not.

I propose adding a new single-line constructor to the Color class that's simply this: public Color() { }

diogotr7 commented 1 year ago

Added.