<section class="usage-guides">

<section class="overview">

## Overview

Use the Cardinal color values instead of specifuying and hard-coding individual instances. As such, application of the robust set of Cardinal variables reinforces maintainability.

To assist in accessibility focused color creation, utilize <a href="https://material.io/tools/color/#!/?view.left=0&view.right=0" target="_blank" rel="noopener noreferrer">Material's color tool</a>

</section>

<section class="usage-guides">

<hr>

## Usage

### Installation

<hr class="ta-shortDivider">

Please consult the <a href="http://dds.us.aegon.com/implementation" target="_blank" rel="noopener noreferrer">Implementation</a> section before continuing with component specific instructions.

Install @cardinal/color with `$ npm install --save @cardinal/color`

The source files included are written in <a href="http://sass-lang.com/" target="_blank" rel="noopener noreferrer">Sass</a>. Point the sass include-path to the node_modules directory and import with:

```javascript
@import "node_modules/@cardinal/color/color";
```

</section>

<section class="usage-guides">

### classes for Text colors

<hr class="ta-shortDivider">

Using this class syntax colors your text to the approved hex color value on that element.

<!-- begin code example -->
<section class="code-example">
<p class="ta-blue500Txt -centerText -pb-lg">.ta-blue500Txt</p>
<p class="ta-red500Txt -centerText">.ta-red500Txt</p>
</section>
<!-- end begin code example -->

<!-- begin code snippet -->
```html
<p class="ta-blue500Txt -centerText -pb-lg">.ta-blue500Txt</p>
<p class="ta-red500Txt -centerText">.ta-red500Txt</p>
```
<!-- end code snippet -->

</section>

<section class="usage-guides">

### classes for background colors

<hr class="ta-shortDivider">

Using this class syntax colors your background with the approved hex color value.
<p class="warning"> This also provides the appropriate <a href="https://www.w3.org/TR/WCAG20/#visual-audio-contrast7" target="_blank" rel="noopener noreferrer">accessibility friendly</a> color value ratio for background to text. </p>

<!-- begin code example -->
<section class="code-example">
  <div class="ta-row">
    <div class="ta-col -sm6 ta-blue500Bg -centerText -p-6xl"><p>.ta-blue500Bg</p></div>
    <div class="ta-col -sm6 ta-blue100Bg -centerText -p-6xl"><p>.ta-blue100Bg</p></div>
  </div>
</section>
<!-- end begin code example -->

<!-- begin code snippet -->
```html
  <div class="ta-row">
    <div class="ta-col -sm6 ta-blue500Bg -centerText -p-6xl"><p>.ta-blue500Bg</p></div>
    <div class="ta-col -sm6 ta-blue100Bg -centerText -p-6xl"><p>.ta-blue100Bg</p></div>
  </div>
```
<!-- end code snippet -->

</section>

<section class="usage-guides">
  
### Sass Functions

<hr class="ta-shortDivider">

#### Functions

`ta-color()`

Accepts two parameters, `ta-color($colorName, $colorNumber)` which will provide the corresponding existing hex value.

```css
#header {
  background-color: ta-color('red', 500);

  h1 {
    color: ta-color('white');
  }

  p {
    color: ta-color('grey', 100);
  }
}
```

Utility colors are also available with only passing the utility `ta-color($colorName)`.

```css
.error {
  background-color: ta-color('error');
}
```

</section>
