import React from 'react';
import { ratio, score } from 'wcag-color';

interface ContrastProps {
  foreground: string;
  background: string;
}

export const Contrast = ({ foreground, background }: ContrastProps) => {
  return (
    <td style={{ color: foreground, backgroundColor: background }}>
      {score(foreground, background)} {ratio(foreground, background)}
    </td>
  );
};
