Color text based on background color when using `_background_gradient()`
The purpose of this PR is to automatically color text dark or light based on the background color of the HTML table:

================`old behavior` ===========================`new behavior`========
![image](https://user-images.githubusercontent.com/4560057/40745876-b43b17ca-6426-11e8-892c-7f27598789de.png) ![image](https://user-images.githubusercontent.com/4560057/40744927-0e2796a8-6424-11e8-9837-53566d53bef6.png)

As described in #21258, I use the luminance-based approach from `seaborn`'s annotated heatmaps. Tagging @WillAyd who commented on that issue. A few comments on this PR

1. Initially, I was not sure if defining the `relative_luminance()` method within `_background_gradient()` was the right way to go, but I opted for this since I saw the same approach elsewhere in the file. Let me know if you prefer a different approach.

2. I am not sure how intuitive it is that a parameter named `text_color` takes a numeric argument and not a color, but I think it is a good name for discoverability. Naming it `luminance_threshold` or similar might be confusing for users looking for a way to change the text color.

3. I opted to make the light text not completely white. The focus should be the background color so the text should not pop out too much. Thoughts?


================`#ffffff` ============================`#f1f1f1` (current choice)===
![image](https://user-images.githubusercontent.com/4560057/40744958-25ba1ac0-6424-11e8-9b51-afaf0a1d05c8.png) ![image](https://user-images.githubusercontent.com/4560057/40744927-0e2796a8-6424-11e8-9837-53566d53bef6.png)

![image](https://user-images.githubusercontent.com/4560057/40745533-b2b81c46-6425-11e8-8bdd-e743441a5b18.png) ![image](https://user-images.githubusercontent.com/4560057/40745507-a54dd0e6-6425-11e8-8e92-50afbd986c57.png)


4. I think 0.2 is a good default threshold value for `text_color` based on my own qualitative assessment, feel free to disagree. The seaborn default of 0.4 makes too much text white in my opinion. Since colors and contrast can be quite subjective, I thought I would include some comparisons.

============`text_color=0.4` ======================`text_color=0.2` (current choice)===
![image](https://user-images.githubusercontent.com/4560057/40745779-6620b1ee-6426-11e8-830a-6517239c8305.png) ![image](https://user-images.githubusercontent.com/4560057/40745632-f692805a-6425-11e8-8f1f-9ff00b81965f.png)
![image](https://user-images.githubusercontent.com/4560057/40745801-7332014e-6426-11e8-88b5-75b34ecfd6ca.png) ![image](https://user-images.githubusercontent.com/4560057/40745647-0653f08c-6426-11e8-995f-b69e6dd1c85c.png)
![image](https://user-images.githubusercontent.com/4560057/40745756-4fd3ef5a-6426-11e8-9335-855a09c2ec56.png) ![image](https://user-images.githubusercontent.com/4560057/40745721-3d98f48e-6426-11e8-9511-a3a9d4b52225.png)


This is my first PR, apologies if I have misunderstood something. 

- [x] closes #21258 
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
