Skip to content
Commit 9bde1cc9 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

ColorUtils: Handle cases where hue is -1 in linearInterpolate

When a color has a saturation of 0 the hue is undefined. QColor
expresses this by returning -1 for the hue of those colors. When that
happens, just naively interpolating that results in incorrect colors. So
instead account for this case by either using the other color's hue or
if both are -1, just using 0.

Additionally, since we're using floats in the calculations here, use the
various float-based getters/setters instead of relying on implicit
conversions.
parent c1bcb6b3
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment