Seaborn has the ability to create beautiful color palettes. I want to use these palettes to generate colors that work well together on a map where countries are shaded according to some properties. The following code generates 8 shades of purple from light to dark. Note that you also need to specify the number of colors, so I cannot just use a fixed palette of certain colors.
import seaborn as sns num_shades = 8 sns.palplot(sns.cubehelix_palette(num_shades))
If I run the same, but in a list, for example:
color_list = sns.cubehelix_palette(num_shades)
You get:
[[0.9312692223325372, 0.8201921796082118, 0.7971480974663592], ...
These are clearly not the RGB values ββthat I need.
1) What format are these colors in? 2) How can I convert to RGB or 6-digit codes?
I searched for a long time and did not find the answers. I looked here at another documentation on the sea:
https://stanford.edu/~mwaskom/software/seaborn/generated/seaborn.set_color_codes.html
I can convert to 6 digit codes from RGB using:
Convert RGB color set to six-digit code in Python
but I stick with how to do this directly or through getting RGB values. Any help would be appreciated.
python rgb seaborn
Pete
source share