Worked out a bunch of math on paper, now the ugly jumps no longer occur!
Just experimenting. Trying to emulate amberlight... and failing miserably http://www.escapemotions.com/products/amberlight/