             val = _min + ((_domain[i] + (_domain[i+1] - _domain[i]) * 0.5 - minc) / (maxc-minc)) * (_max - _min)
         val
 
-    getColor = (val) ->
+    getColor = (val, bypassMap=false) ->
         if isNaN(val) then return _nacol
         if _domain.length > 2
             c = getClass val
-            f = c / (_numClasses-1)
+            t = c / (_numClasses-1)
         else
-            f = f0 = (val - _min) / (_max - _min)
-            f = Math.min(1, Math.max(0, f))
+            t = f0 = (val - _min) / (_max - _min)
+            t = Math.min(1, Math.max(0, t))
+
+        if not bypassMap
+            t = tmap t  # lightness correction
 
         if type(_colors) == 'array'
             for i in [0.._pos.length-1]
                 p = _pos[i]
-                if f <= p
+                if t <= p
                     col = _colors[i]
                     break
-                if f >= p and i == _pos.length-1
+                if t >= p and i == _pos.length-1
                     col = _colors[i]
                     break
-                if f > p and f < _pos[i+1]
-                    f = (f-p)/(_pos[i+1]-p)
-                    col = chroma.interpolate _colors[i], _colors[i+1], f, _mode
+                if t > p and t < _pos[i+1]
+                    t = (t-p)/(_pos[i+1]-p)
+                    col = chroma.interpolate _colors[i], _colors[i+1], t, _mode
                     break
         else if type(_colors) == 'function'
-            col = _colors f
+            col = _colors t
         col
 
     setColors colors, positions

    _pos = []
    _min = 0
    _max = 1
    _numClasses = 0

    # private methods

            return i-1
        return 0

    tmap = (t) -> t

    classifyValue = (value) ->
        val = value
        if _domain.length > 2
