# FH-Color

Die Fraunhofer Farben für Python als Matplotlib Colormaps

## Colors

```python
import FHColors as fhc

print(fhc.colors.green1)
```
returns

```python
array([0.09019608, 0.61176471, 0.49019608, 1.        ])
```
available colors are:

* <span style="color:#179c7d">green1</span>
* <span style="color:#eb6a0a">orange1</span>
* <span style="color:#006e92">blue1</span>
* <span style="color:#e2001a">red1</span>
* <span style="color:#b1c800">green2</span>
* <span style="color:#feefd6">orange2</span>
* <span style="color:#25bae2">blue2</span>
* <span style="color:#e1e3e3">grey1</span>
* <span style="color:#a8afaf">grey2</span>


## Maps

```python
print(fhc.maps.BlackToGreenToWhite(.5))
```
returns

```python
(0.2497071555895085, 0.6798319327731093, 0.5795772854596384, 1.0)
```
available maps are:

* BlackToGreen
* WhiteToGreen
* GreenToWhite
* OrangeToGreen
* GreenToOrange
* BlackToGreenToOrangeToWhite
* BlackToGreenToWhite
* BlackToGreenToWhite_short
* colors
## Example 1

```python
from FHColors import colors, maps
import numpy as np
import matplotlib.pyplot as plt

maps=[maps.BlackToGreen,maps.GreenToWhite,maps.GreenToOrange,maps.BlackToGreenToOrangeToWhite,maps.BlackToGreenToWhite,maps.BlackToGreenToWhite_short,maps.colors]
mapnames=['maps.BlackToGreen','maps.GreenToWhite','maps.GreenToOrange','maps.BlackToGreenToOrangeToWhite','maps.BlackToGreenToWhite','maps.BlackToGreenToWhite_short','maps.colors']
fig,axes=plt.subplots(nrows=len(maps), ncols=1)
fig.set_figheight(20)
fig.patch.set_facecolor(colors.grey1)
for ii,m in enumerate(maps):
    for i in np.arange(0,256,1):
        light=np.sum(m(i)[:3])/3
        axes[ii].plot([i],[light], 'o', markersize=30, color=m(i))
    axes[ii].set_xlabel('Colorvalue')
    axes[ii].set_ylabel('Brightness')
    axes[ii].title.set_text(mapnames[ii])
    axes[ii].patch.set_facecolor(colors.grey1)
plt.tight_layout(pad=3)
plt.savefig('maps.png',facecolor=fig.get_facecolor(), edgecolor='none')
plt.show()
```

![](maps.png)

## Example 2

```python
import seaborn as sns

df = sns.load_dataset('iris')

sns.boxplot(data=df,x='species',y='sepal_length',palette=sns.color_palette([colors.orange1,colors.green1,colors.green1]))
fig=plt.gcf()
ax=plt.gca()
ax.set_title('Highlighting Setosa')
fig.patch.set_facecolor(colors.grey1)
ax.patch.set_facecolor(colors.grey1)
plt.tight_layout()
#plt.savefig('Boxplot_Eta_corr.png',facecolor=fig.get_facecolor(), edgecolor='none')
plt.show()
```