There is already a hueToRgb and hsbToRgb function in the color logic and darkenRgb should be promoted there and the core paint.py retested.