I would suggest to use the `create_cdict` function instead of repeat it inside here.

So, change this:
```python
i = np.linspace(0, 1, 256)

 cdict = dict(
     (name, list(zip(i, el, el)))
     for el, name in [(hmi_mag_r, 'red'), (hmi_mag_g, 'green'), (hmi_mag_b, 'blue')]
     )
```

for just:

```python
cdict = create_cdict( hmi_mag_r * 255, hmi_mag_g * 255, hmi_mag_b * 255)
```
Though I think to standarize all I would multiply the arrays by 255 in their definition (above).