Ticket #8: auto-lighting.diff
| File auto-lighting.diff, 0.7 kB (added by jae@…, 4 years ago) |
|---|
-
color.py
48 48 clamp(0.0, 1.0, g + amount), 49 49 clamp(0.0, 1.0, b + amount)) 50 50 51 def generateColorscheme(masterColor, keys , light=0.098):51 def generateColorscheme(masterColor, keys): 52 52 """Generates a dictionary where the keys match the keys argument and 53 53 the values are colors derivated from the masterColor. 54 54 … … 58 58 The masterColor is given in a hex string format. 59 59 """ 60 60 r, g, b = hex2rgb(masterColor) 61 light = 1.0 / (len(keys)*2) 61 62 return dict([(key, lighten(r, g, b, light * i)) 62 63 for i, key in enumerate(keys)]) 63 64
