lxn / win

A Windows API wrapper package for the Go Programming Language
Other
1.19k stars 313 forks source link

Proper custom color handling #56

Closed SilverCory closed 5 years ago

SilverCory commented 5 years ago

https://docs.microsoft.com/en-gb/windows/desktop/api/commdlg/ns-commdlg-tagchoosecolora

The Microsoft documentation says that type LpCustColors is as follows:

A pointer to an array of 16 values that contain red, green, blue (RGB) values for the custom color boxes in the dialog box. If the user modifies these colors, the system updates the array with the new RGB values.

SilverCory commented 5 years ago

working working 2

Can confirm this works.

lxn commented 5 years ago

Sorry for the late response.

It works either way, but your change seems preferable.

Please add yourself to the AUTHORS file.

Thanks!

SilverCory commented 5 years ago

It works but the custom colours wouldn't work from what I could tell. Either that or I've misunderstood something about ColourRef?

Will do, thanks for accepting the PR.

lxn commented 5 years ago

Nothing special about COLORREF. You just would have initialized LpCustColors to the first item in the array, just like with C. But I actually prefer your change, so thank you!

SilverCory commented 5 years ago

Ahhh okay, I wouldn't have thought that would work. Nice talking to you! :)