                 hue = undefined
 
             sat ?= sat0 + f*(sat1 - sat0)
-
             lbv = lbv0 + f*(lbv1-lbv0)
 
-            new Color(hue, sat, lbv, m)
+            new Color hue, sat, lbv, m
 
         else if m == 'rgb'
             xyz0 = me._rgb

        m ?= 'rgb'
        col = new Color(col) if type(col) == "string"

        if m == 'hsl' or m == 'hsv' or m == 'lch' or m == 'hsi'
            if m == 'hsl'
                xyz0 = me.hsl()
                xyz1 = col.hsl()
            else if m == 'hsv'
                xyz0 = me.hsv()
                xyz1 = col.hsv()
            else if m == 'lch'
                xyz0 = me.lch()
                xyz1 = col.lch()
            else if m == 'hsi'
                xyz0 = me.hsi()
                xyz1 = col.hsi()

            [hue0, sat0, lbv0] = xyz0
            [hue1, sat1, lbv1] = xyz1

            if not isNaN(hue0) and not isNaN(hue1)
                if hue1 > hue0 and hue1 - hue0 > 180

# Browserify-compatible export
module.exports = chroma if module?


class Color

    constructor: (x,y,z,m) ->
        me = @

