hyprwm / hyprpicker

A wlroots-compatible Wayland color picker that does not suck.
BSD 3-Clause "New" or "Revised" License
670 stars 30 forks source link

Fix CMYK output on black #69

Closed felixdorn closed 4 months ago

felixdorn commented 5 months ago

Reproduce:

Fix:

The current implementation does not handle the case where K = 0, which causes a divide by zero error when computing c, m, y which are of the form [expr] / K.

In this case, setting K = 1 is a correct way to handle this edge case.