Open e-domnenko opened 1 year ago
This PR fixes issue #48 in difference function.
difference function returns NaN if one of colours provided as argument is garyscale (e.g. #f0f0f0, #4d4d4d, #eeeeee).
difference
NaN
#f0f0f0
#4d4d4d
#eeeeee
The dH formula a^2+b^2-c^2 can be less than zero because of rounding errors caused by floating number precision.
a^2+b^2-c^2
This PR fixes issue #48 in difference function.
difference
function returnsNaN
if one of colours provided as argument is garyscale (e.g.#f0f0f0
,#4d4d4d
,#eeeeee
).