// @flow
import { getPaletteColor } from '../../../mixins/branding';
import type { PatchworkTheme } from '../../../themes';
import type { ColorPaletteColorNameKey } from '../../../mixins/branding';

export const getChevronColor = (
  theme: PatchworkTheme,
  colorName: ColorPaletteColorNameKey = 'greyscale-darker',
) => getPaletteColor(colorName)({ theme });

export const getUrlEncodedChevronColor = (theme: PatchworkTheme) => {
  const rawColor = getChevronColor(theme);
  return encodeURIComponent(rawColor != null ? rawColor : 'gray');
};
