function extractScale(cont) {
    var cOpts = extractOpts(cont);
    var cmin = cOpts.min;
    var cmax = cOpts.max;

    var scl = cOpts.reversescale ?
        flipScale(cOpts.colorscale) :
        cOpts.colorscale;

    var N = scl.length;
    var domain = new Array(N);
    var range = new Array(N);

    for(var i = 0; i < N; i++) {
        var si = scl[i];
        domain[i] = cmin + si[0] * (cmax - cmin);
        range[i] = si[1];
    }

    return {domain: domain, range: range};
}
Extract colorscale into numeric domain and color range.

@param {object} cont colorscale container (e.g. trace, marker)
 - colorscale {array of arrays}
 - cmin/zmin {number}
 - cmax/zmax {number}
 - reversescale {boolean}

@return {object}
 - domain {array}
 - range {array}