Can't debug Code, to show change in temperature as colour with a RGB

Your code doesn't compile, so debugging is some way off.

One useful technique is to first make your code more legible, but you'll soon find that the auto format tool doesn't work on the code you posted, giving you the useful clue "Too many left curly braces".