Changeset 78 for trunk/src/color.py
- Timestamp:
- 03/20/08 13:24:03 (4 years ago)
- Files:
-
- 1 modified
-
trunk/src/color.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/color.py
r45 r78 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 55 Each color is a lighter version of masterColor separated by a difference56 given by the light argument.55 Each color is a lighter version of masterColor. This difference is 56 computed based on the number of keys. 57 57 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)])
