Created
October 9, 2016 19:51
-
-
Save mortie/100469058081fc47c7afe4ccf17c28fd to your computer and use it in GitHub Desktop.
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
def color_fn_weighted_random(x): | |
if x == 0: | |
x = 101 | |
x = 101 - x | |
x = min(int((x / 101) * 255), 255) | |
arr = [ | |
min(randint(int(x // 4), x), 255), | |
min(randint(int(x // 4), x), 255), | |
min(randint(int(x // 4), x), 255)] | |
arr[randint(0, 2)] *= 4 | |
return arr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment