Created
April 30, 2015 06:09
-
-
Save geogradient/c226eb0c98f45a0d5310 to your computer and use it in GitHub Desktop.
# Function to make an automatic colour list holding Hex values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import colorsys | |
def get_N_HexCol(N=5): | |
HSV_tuples = [(x*1.0/N, 1, 1) for x in xrange(N)] | |
hex_out = [] | |
for rgb in HSV_tuples: | |
rgb = map(lambda x: int(x*255),colorsys.hsv_to_rgb(*rgb)) | |
hex_out.append("".join(map(lambda x: chr(x).encode('hex'),rgb))) | |
return ["#"+c_value for c_value in hex_out] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment