// @flow
import { getPaletteColor } from '../../../mixins/branding';
import type { BrandProps } from '../../../mixins/branding';
import type { TypographyProps } from '../../../mixins/typography';
import type { ThemeProps } from '../../../types';

export const getLinkColor = ({
  theme,
  colorName,
}: {|
  ...ThemeProps,
  ...BrandProps,
|}) => (colorName ? getPaletteColor(colorName)({ theme }) : 'inherit');

export const getLinkFontSize = ({
  theme,
  fontSize,
}: {|
  ...ThemeProps,
  ...TypographyProps,
|}) =>
  fontSize != null && theme.typescale[fontSize] != null
    ? theme.typescale[fontSize]
    : 'inherit';
