📅  最后修改于: 2022-03-11 14:45:35.713000             🧑  作者: Mango
def color_negative_red(val):
"""
Takes a scalar and returns a string with
the css property `'color: red'` for negative
strings, black otherwise.
"""
color = 'red' if val < 0 else 'black'
return 'color: %s' % color