https://github.com/windowsnt/colorpicker
Win32 Direct2D Modern ColorPicker
https://github.com/windowsnt/colorpicker
alpha-channel colorpicker cplusplus direct2d hsl rgb win32
Last synced: 2 months ago
JSON representation
Win32 Direct2D Modern ColorPicker
- Host: GitHub
- URL: https://github.com/windowsnt/colorpicker
- Owner: WindowsNT
- Created: 2020-06-01T16:50:13.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-29T10:00:59.000Z (over 4 years ago)
- Last Synced: 2025-03-24T13:36:06.861Z (3 months ago)
- Topics: alpha-channel, colorpicker, cplusplus, direct2d, hsl, rgb, win32
- Language: C++
- Size: 438 KB
- Stars: 23
- Watchers: 4
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Direct2D Modern ColorPicker for Win32 with Alpha support
```C++
Features
* One header file
* Direct2D drawing
* Alpha
* HSL and RGB support
* Can use the system dialog
* Supports a picker```

To use, simply:
```C++
COLORPICK cp;
D2D1_COLOR_F red = {1.0f,0,0,1.0f};
HRESULT hr = cp.Show(hParent,red);
if (hr == S_OK)
{
// Color is set
}```
Optionally you can configure parameters by passing this structure:
```C++
struct COLORPICKOPT
{
bool Alpha = 1;
int Mode = 1;
bool Dlg = 1;
bool LUpdate = 0;
bool AlsoUseSystem = 1;
bool UsePicker = 1;
float Resolution = 0.1f;
};```