Skip to content

Commit

Permalink
fix: cmyk conversion on pure black (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixdorn authored Apr 11, 2024
1 parent 0eb4919 commit be7a0e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/events/Events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit be7a0e8

Please sign in to comment.