mirror of
https://github.com/hyprwm/hyprpicker.git
synced 2024-11-16 16:15:58 +01:00
fix: cmyk conversion on pure black (#69)
This commit is contained in:
parent
0eb49192a5
commit
be7a0e82c4
1 changed files with 1 additions and 1 deletions
|
@ -151,7 +151,7 @@ void Events::handlePointerButton(void* data, struct wl_pointer* wl_pointer, uint
|
|||
// http://www.codeproject.com/KB/applications/xcmyk.aspx
|
||||
|
||||
float r = 1 - COL.r / 255.0f, g = 1 - COL.g / 255.0f, b = 1 - COL.b / 255.0f;
|
||||
float k = fmin3(r, g, b), K = 1 - k;
|
||||
float k = fmin3(r, g, b), K = (k == 1) ? 1 : 1 - k;
|
||||
float c = (r - k) / K, m = (g - k) / K, y = (b - k) / K;
|
||||
|
||||
c = std::round(c * 100);
|
||||
|
|
Loading…
Reference in a new issue