"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = getContrastText;
var _styles = require("@material-ui/core/styles");
/**
 * @param {string} background
 * @param {*} [options]
 * @param {string} [options.darkColor]
 * @param {string} [options.lightColor]
 * @param {string} [options.threshold]
 * @return {string}
 */
function getContrastText(background) {
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var _options$darkColor = options.darkColor,
    darkColor = _options$darkColor === void 0 ? '#000000' : _options$darkColor,
    _options$lightColor = options.lightColor,
    lightColor = _options$lightColor === void 0 ? '#ffffff' : _options$lightColor,
    _options$threshold = options.threshold,
    threshold = _options$threshold === void 0 ? 10 : _options$threshold;
  return (0, _styles.getContrastRatio)(background, darkColor) >= threshold ? darkColor : lightColor;
}