Whats the best way to detect emotions?

Im building an js app that allows you to create AI based presentations and now the only problem left is creating a design for presentations, what i want to do, is to detect emotional component of the input, then compare it to colors ( for example if text is sad itll be dark blue), and then use this color as a base for my presentation design. I think this can be done with gpt embeddings, but im not sure. I need a spectrum of emotions as output(more then just negative, positive and neutral) Also if you know any other free solution id be very glad to hear them

The easiest would be to make an AI language classifier. Prompt an AI model with a table of the spectrum of moods, with examples of keywords expressing what ideas should be looked for, and the one-word output to be produced.

do you have info where i can learn about it? Would appreciate it