Skip to content

Commit

Permalink
feat: add contrast ratio to the display (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanb authored and schne324 committed Mar 25, 2018
1 parent 8578f91 commit 82b2237
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/color-palette.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ function getColorRows(combos, onColorSuggestion) {
Sample Text
</td>
<td>
{ contrast >= 4.5 ? '\u2714' : '\u2718'}
{ `${(contrast >= 4.5 ? '\u2714' : '\u2718')} (${contrast.toFixed(2)}:1)` }
</td>
<td>
{ contrast >= 3.0 ? '\u2714' : '\u2718'}
{ `${(contrast >= 3.0 ? '\u2714' : '\u2718')} (${contrast.toFixed(2)}:1)` }
</td>
<td>
{ contrast >= 3.0 && contrast < 4.5 ?
Expand Down Expand Up @@ -89,8 +89,7 @@ const ColorPalette = ({ colors, className, onColorSuggestion }) => {
return (<p>Add some colours!</p>);
}
return <div className={`${className}`}>
<table>
<caption>Color Palette Analysis</caption>
<table summary='Color Palette Analysis'>
<thead>
<tr>
<th scope="col">
Expand Down

0 comments on commit 82b2237

Please sign in to comment.