src/plotty.js
function addColorScale(name, colors, positions) {
  if (colors.length !== positions.length) {
    throw new Error('Invalid color scale.');
  }
  colorscales[name] = { colors, positions };
}
function addColorScale(name, colors, positions) {
  if (colors.length !== positions.length) {
    throw new Error('Invalid color scale.');
  }
  colorscales[name] = { colors, positions };
}
function addColorScale ( name , colors , positions ) { if ( colors . length !== positions . length ) { throw new Error ( 'Invalid color scale.' ) ; } colorscales [ name ] = { colors , positions } ; }
Add a new colorscale to the list of available colorscales.
@memberof module:plotty
@param {String} name the name of the newly defined color scale
@param {String[]} colors the array containing the colors. Each entry shall
adhere to the CSS color definitions.
@param {Number[]} positions the value position for each of the colors
Add a new colorscale to the list of available colorscales .