I think you need some kind of service to determine the mood from the data the variable contains.
For example, I can easily call:
https://azure.microsoft.com/en-in/services/cognitive-services/text-analytics/
to distinguish between "acceptable" and "unacceptable." In the link, you can actually call the service with both words and see that in the first case, the result returns 98%, and for the other - 2%. You can use this value even while generating a smooth range of rgb colors.
source share