Navigation Menu

Skip to content
This repository has been archived by the owner on Nov 25, 2017. It is now read-only.

Commit

Permalink
improving middle color calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Drackett committed Jan 17, 2009
1 parent 802b864 commit 4432675
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions templatetags/charts.py
Expand Up @@ -339,9 +339,6 @@ def chart_auto_colors(color, item_label_list):

colors = []

# Set up our saturation multiplier
increment = 1 + len(item_label_list)

# For each label, compute a new color
for index, color in enumerate(range(0, len(item_label_list))):
if index == 0:
Expand All @@ -352,7 +349,7 @@ def chart_auto_colors(color, item_label_list):
value = hsv[1] * .2
else:
# otherwise, do a calculation
value = (.80 /(len(item_label_list) - 1)) * hsv[1]
value = 1 - (float(1)/(len(item_label_list))) * hsv[1]

# Convert back to rgb
c_list = colorsys.hsv_to_rgb(hsv[0], value, hsv[2])
Expand Down

0 comments on commit 4432675

Please sign in to comment.