You did not really answer my questions

Are you asking to sum the values from cells that have a background color applied to them?
If so, then, sorry, excel cannot "see" color, so unless there is some logic to how the color was applied, then there is no formula that will sum colored cells for you.

If youi meant that you want to APPLY color to certain cells, then as suggested, you could do that with Conditional Formatting.
It sounds like you want to add/sum the contents, based on the cell color. If so, like I said, there is no formula to do that.

What determines the color of a cell? Is it just a color you picked and applied manually?