def neutrality_color(self): num = clamp(self.cumulative_neutrality, 70, 100) return color(num, [70,100], color1='808080', color2='0000FF')
def color(self): num = clamp(self.cumulative_sentiment, -25, 25) return color(num, [-25,25])
def neutrality_color(self): """Same as color but for neutrality, between grey and blue""" num = clamp(self.neutrality, 70, 100) return color(num, [70,100], color1='808080', color2='0000FF')
def compound_color(self): """Same as color and neutrality_color but for compound.""" return color(self.compound, [-100,100])
def color(self): """A property for generating a color between red and green for the sentiment of the article. """ num = clamp(self.sentiment, -25, 25) return color(num, [-25,25])