Permalink
Browse files

Fixed an error in contrast_color filter

  • Loading branch information...
1 parent 154a4d9 commit e84e8fe80072dbd930552e911f6471a8fa9c2bab @esquevin esquevin committed Mar 30, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 colors/templatetags/colors.py
@@ -74,7 +74,7 @@ def opposite(x):
def contrast_color(x):
"""Return foreground colors (either black or white) in contrast to the color you provide"""
- x = hex_to_hsv(expand_hex(x))
+ x = expand_hex(x)
h, l, s = cs.rgb_to_hls(int(x[0:2], 16)/255.0, int(x[2:4], 16)/255.0, int(x[4:6], 16)/255.0)
if l > 0.5:
return '000000'

0 comments on commit e84e8fe

Please sign in to comment.