1def color_negative_red(val):
2 """
3 Takes a scalar and returns a string with
4 the css property `'color: red'` for negative
5 strings, black otherwise.
6 """
7 color = 'red' if val < 0 else 'black'
8 return 'color: %s' % color
9