import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import seed from "seed-random";
import * as colors from "@material-ui/core/colors";

var fade = function fade(cmap, amt) {
  var newCmap = {};

  for (var i = 100; i < 1000; i++) {
    if (i - amt <= 0) {
      newCmap[i] = "#fff";
    } else {
      newCmap[i] = cmap[i - amt];
    }
  }

  return newCmap;
};

var fadedGrey = _objectSpread(_objectSpread({}, colors.grey), {}, {
  // "800": colors.grey[600],
  // "700": colors.grey[500],
  // "600": colors.grey[400],
  // "500": colors.grey[300],
  // "400": colors.grey[200],
  // "300": colors.grey[100],
  isFaded: true
});

var availableColors = [colors.blue, colors.deepOrange, colors.green, colors.purple, colors.pink, colors.cyan, colors.orange, colors.indigo];

var colorMap = _objectSpread(_objectSpread({}, colors), {}, {
  complete: colors.blue,
  incomplete: fadedGrey,
  faded: fadedGrey,
  review: colors.deepOrange,
  ellipsis1: fade(colors.grey, 100),
  ellipsis2: fade(colors.grey, 200),
  ellipsis3: fade(colors.grey, 300)
});

export default (function (brush) {
  return colorMap[brush] || availableColors[seed(brush) * availableColors.length];
});