I don't think there's a specific function for that.
If you want to sum cells that are colored by Conditional Formatting, you can duplicate the Conditional Formatting "conditions" within a formula and sum cells that match those conditions.
If you have "manually" formatted certain cells (say every odd row), and you want to sum cells in a given range that have the format, often there are ways to replicate that format pattern e.g. every odd cell in a range.
If you give more specifics on what exactly you want to do and how your data is configured (examples are always good), usually someone around here will come up with a solution.