import Buffer from "buffer";
import processBrowser from "process/browser";
import console from "console-browserify";
var buffer = {
  Buffer
};
const sectionColor = ["#028391"];
const elementColor = ["#01204E"];
const highlightColorForSection = "#01204E";
const highlightColorForElement = "#fd5907";
function djb2Hash(str) {
  if (!str) {
    str = "unnamed";
  }
  let hash = 5381;
  for (let i = 0; i < str.length; i++) {
    hash = (hash << 5) + hash + str.charCodeAt(i);
  }
  return hash >>> 0;
}
function colorForName(name) {
  const hashNumber = djb2Hash(name);
  return elementColor[hashNumber % elementColor.length];
}
function highlightColorForType(type) {
  return highlightColorForElement;
}
function globalThemeConfig() {
  return {
    token: {
      colorPrimary: "#06b1ab"
    },
    components: {
      Layout: {
        headerHeight: 60,
        headerPadding: "0 30px",
        headerBg: "#FFF",
        bodyBg: "#FFF"
      }
    }
  };
}
export {
  colorForName,
  globalThemeConfig,
  highlightColorForType
};
