Color your favorite albums into seaborn or matplotlib.
These palettes are the result of employing KMeans clustering on the color data extracted from the album covers.
The album selection for each artist was influenced by the colors of their cover, instead of their quality or representativeness.
Other albums are free to join this package. Open a PR with the album cover and the name of the artist and album.
Inspiration:
$ pip install album_colours
Use this way into your notebook or script:
from album_colours import palette_generator
palette = palette_generator.color_gradient_generator('<palette>', 2)
We currently support the following albums:
devendra
Flying Wig - Devendra Banhartalvaro_diaz
Felicilandia - Álvaro Díazalvaro_diaz2
Single Llori Pari - Álvaro Díazaventura
The Last - Aventurabad_bunny
Un verano sin ti - Bad Bunnyfrank_ocean
Blonde - Frank Oceankanye
The life of pablo - Kanye Westkendrick
DAMN - Kendrick Lamarkendrick2
good kid, m.A.A.d city - Kendrick Lamarkendrick3
Mr. Morale & the Big Steppers - Kendrick Lamarradiohead
Kid A - Radioheadrosalia
El Mal Querer - Rosalíarosalia2
Motomami - Rosalíasen_senra
Sensaciones - Sen Senrasoda_stereo
Nada Personal - Soda Stereotyler
Flower Boy - Tyler, the Creator
- Please see the example notebook.
Some of the palettes look like this:
bad_bunny
Un verano sin ti - Bad Bunny
rosalia2
Motomami - Rosalía
alvaro_diaz
Felicilandia - Álvaro Díaz
kanye
The life of pablo - Kanye West
kendrick3
Mr. Morale & the Big Steppers - Kendrick Lamar
radiohead
Kid A - Radiohead
The library at its core has the principal colors as a list of hex values. Use the palette_generator.color_gradient_generator()
function to build and view your palettes.
palette
- The name of the palette you want to generate. See the list of available above. If the palette is not found, it will return an empty list.color_count
- The number of colors you want to generate. Default is the length of elements in the list.palette_type
- The type of palette you want to generate. Options arediscrete
andcontinuous
. Default isdiscrete
.
Its also recommended if you want to have the colors but in different order to use
sample()
fromrandom
package. As it is shown in theexamples_plots.ipynb
notebook.
palette_generator.color_gradient_generator('bad_bunny')
palette_generator.color_gradient_generator('rosalia', 4)
palette_generator.color_gradient_generator('bad_bunny', 20)
palette_generator.color_gradient_generator('rosalia', 20)
The library returns a list of colors that can be used in seaborn or matplotlib plots. Read more about it here: https://seaborn.pydata.org/tutorial/color_palettes.html
All examples are in the example notebook.
# all imports ...
bad_bunny = palette_generator.color_gradient_generator('bad_bunny', 9)
sns.set_palette(bad_bunny)
sns.scatterplot(x="total_bill", y="tip", hue="sex", size="size", sizes=(50, 200), data=tips)
p = palette_generator.color_gradient_generator('aventura', 9)
p_random = random.sample(p, 2)
sns.set_palette(p_random)
sns.relplot(
data=fmri, kind="line",
x="timepoint", y="signal", col="region",
palette=p_random,
hue="event", style="event",
)
p = palette_generator.color_gradient_generator('tyler', 9)
p_random = random.sample(p, 2)
sns.set_palette(p_random)
sns.catplot(data=tips, kind="violin", x="day", y="total_bill", hue="smoker", split=True)
p = palette_generator.color_gradient_generator('alvaro_diaz', 9)
p_random = random.sample(p, 3)
penguins = sns.load_dataset("penguins")
sns.set_palette(p_random)
sns.jointplot(data=penguins, x="flipper_length_mm", y="bill_length_mm", hue="species")
album-colours
was created by Majo Castañeda, Dante Bazaldua. It is licensed under the terms of the MIT license.
For any comments or suggestions, feel free to reach me at dalnte@me.com or @MajoSedCast