Python: calculate lighter/darker RGB colors http://chase-seibert.github.com/blog/2011/07/29/python-calculate-lighterdarker-rgb-colors.html
>>> def color_variant(hex_color, brightness_offset=40):
... rgb_hex = [hex_color[x:x+2] for x in [1, 3, 5]]
... new_rgb_int = [int(hex_value, 16) + brightness_offset for hex_value in rgb_hex]
... new_rgb_int = [min([255, max([0, i])]) for i in new_rgb_int]
... return "#%02x%02x%02x" % tuple(new_rgb_int)
Lighter colors:
>>> ':'.join(map(color_variant, ("#3b3b3b","#cf6a4c","#99ad6a","#d8ad4c","#597bc5","#a037b0","#71b9f8","#adadad")))
'#636363:#f79274:#c1d592:#ffd574:#81a3ed:#c85fd8:#99e1ff:#d5d5d5'
Original colors:
>>> ':'.join(("#3b3b3b","#cf6a4c","#99ad6a","#d8ad4c","#597bc5","#a037b0","#71b9f8","#adadad"))
'#3b3b3b:#cf6a4c:#99ad6a:#d8ad4c:#597bc5:#a037b0:#71b9f8:#adadad'
gconftool --set --type string /apps/gnome-terminal/profiles/Default/foreground_color '#adadad'
gconftool --set --type string /apps/gnome-terminal/profiles/Default/bold_color '#adadad'
gconftool --set --type string /apps/gnome-terminal/profiles/Default/background_color '#151515'
gconftool --set --type string /apps/gnome-terminal/profiles/Default/palette '#3b3b3b:#cf6a4c:#99ad6a:#d8ad4c:#597bc5:#a037b0:#71b9f8:#adadad:#636363:#f79274:#c1d592:#ffd574:#81a3ed:#c85fd8:#99e1ff:#d5d5d5'
No comments:
Post a Comment