code: function(param) {
    var array;
    if (typeof param === "string" || param instanceof String) {
      array = stringToArray(param);
    }
    if (param instanceof Array && param.length > 0) {
      if (typeof param[0] === "string" || param[0] instanceof String) {
        array = simpleArrayToArray(param);
      } else {
        array = param;
      }
    }
    // array is now an array of objects with the properties 'color' and 'offset'.
    if (defined(array)) {
      array.forEach(function(e) {
        this.push(e);
      }, this);
    }
  }
docs: A one-dimensional scale of colours used to visually represent a numerical value.
  Implemented as an Array of {color, offset} objects, where the first object has an offset of 0,
  the last has an offset of 1, and the others are ordered in between.
  It can be instantiated directly from three formats:
  - String, eg. 'red-black'
  - Array of strings, eg. ['red', 'black']
  - Array of objects with the properties 'color' and 'offset', eg. [{color: 'red', offset: 0}, ...].
  
  @param {String|String[]|Object[]} param