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

const resolveColor = (color: Color) =>
  color === 'primary' ? 'brand-primary-base' : 'brand-secondary-base';

export const getBorderColor = (
  theme: PatchworkTheme,
  inverted: boolean,
  color: Color,
) =>
  getPaletteColor(inverted ? resolveColor(color) : 'greyscale-light')({
    theme,
  });

export const getFillColor = (
  theme: PatchworkTheme,
  inverted: boolean,
  color: Color,
) => getPaletteColor(inverted ? resolveColor(color) : 'white')({ theme });

export const getFontColor = (
  theme: PatchworkTheme,
  inverted: boolean,
  color: Color,
) => getPaletteColor(inverted ? 'white' : resolveColor(color))({ theme });
