How do i get the colors of blackbody radiation

As the title says, i need a formula or function to get the color of stars/fire depending on a temperature value

I don’t really get what you want to achieve but I’d assume that you could make a table of all the possible colours with its respective temperatures

if you only want approximations, you may google “blackbody color”. go to “Image” tab, there are some color gradient images. Some of them have the associated temperature. You can then use colorpicker to sample the colors at different temperatures, put it into table. and then interpolate the color based on the input temperature

found this thing online

Good luck figuring out how to use it though