import { defaultPalette, palettes } from './electionPalettes';

/**
 * Get a particular election palette.
 *
 * @param {ElectionColorPaletteId} palette
 *   The name of the palette to use. This should be the name of a valid
 *   election color palette (e.g., `dem`, `gop`).
 * @returns {ElectionPalette}
 */
const getElectionPalette = function getElectionPalette(palette) {
  const colors = palettes[palette];
  if (!colors) return undefined;
  const colorPalette = {
    ...defaultPalette,
    ...colors
  };
  return colorPalette;
};
export default getElectionPalette;