Sheet - Sum by cell color ?

Sheet - Sum by cell color ?

Hi 

Looked everywhere for this and can not work it out. Can do in Excel, but not in sheets.

In a separate cell, I want to add a sum of values based on a cell colour from a column. Like if it is green it is this value, then in a separate cell if it is red it is this value from the same column. Is this possible?