// 'use strict';

const NAMED_COLORS = {
  //Yellow
  digitYellow: "#FFBB00",
  lightYellow: "#FFAA00",
  digitErrorRed: "#DD1111",

  //White
  white: "#FFFFFF",

  //Black
  borderBlack: "#444444",
  darkBlack: "#000000",
  lightBlack: "#F5F5F5",
  lightGray: "#DDDDDD",
  veryLightGray: "#999999",
};

const THEME_COLORS = {
  ...NAMED_COLORS,

  actionText: NAMED_COLORS.textBlack,
  text: NAMED_COLORS.textBlack,
  lightBackground: NAMED_COLORS.grey,
  darkBackground: NAMED_COLORS.black,
  darkText: NAMED_COLORS.black,
  cellBorder: NAMED_COLORS.blueCharcoal,
  lightText: NAMED_COLORS.blueBayoux,
  inactiveText: "#9B9B9B",
  dividerColor: "#EEEEEE",
};

module.exports = {
  ...THEME_COLORS,

  colorWithAlpha(name: string = "black", opacity: number = 1) {
    if (!THEME_COLORS[name]) {
      name = "black";
    }
    return THEME_COLORS[name].split(", 1)").join(`, ${opacity})`);
  },

  colorForTopic(count: number, index: number): string {
    const hue = Math.round((360 * index) / (count + 1));
    return `hsl(${hue}, 74%, 65%)`;
  },
};
