The we heat a metal object the color will change as it gets hotter and hotter. We will go from red hot to white hot. This color is called black body radiation and it reflects the total radiative power per unit of surface area. Below is a diagram of color as a function of the black body surface temperature in degrees Kelvin. The average black body radiation of tour sun 5780K, which is yellowish white. If we heat something to 5780K it would have the color of the sun.
Stars all use the same nuclear fusion reactions to build larger atoms giving off heat in the process. Depending on the strength and speed of these reactions determines the average radiative energy on the surface and the black body color.
Our sun at 5780K can feel very warm in a summer day. If its surface was 9000K you would not be able to go outside without wearing radiant protection. It would be like the sun getting much closer.
Note: A black body is an idealized physical body that absorbs all incident electromagnetic radiation, regardless of frequency or angle of incidence. Black-body radiation is the
thermal electromagnetic radiation within or surrounding a body in thermodynamic equilibrium with its environment, or emitted by a black body(an opaque and non-reflective body).