dimanche 23 juin 2019

How to generate dark shades of hex color codes in python

I am generating random different colors and generating like them below :

 import random
 import numpy as np

 random_number = np.random.randint(0,16777215)
 hex_number = str(hex(random_number))
 hex_number ='#'+ hex_number[2:]

But this generates mostly lighter shades and not dark ones. How can I modify this to generate darker shades.Any help is appreciated.




Aucun commentaire:

Enregistrer un commentaire