Views Group By how to display only group headers with COUNT of rows
I solved it. The problem with my View was that it was by default sorted by post date. Displaying the underlying SQL query showed that it selects the Post Date to be able to sort by it and that's why it displays each row.

So in this case, getting rid of detail rows means getting rid of the default sort. After that, the view displays only the Group Header row and one "Group By" row per group.

Blue
  Blue
Red
  Red
Green
  Green


To get rid of the Group Header row, hide it in CSS or in a relevant template tpl.php

In order to display the count, add the same field to the FIELDS section again, but this time with Aggregation Settings set to Count. It will look like this:

Blue
2
Red
3
Green
1


To add parenthesses, add Prefix and Suffix to the Field format. To display inline, check both fields in FORMAT->Field Settings->Display inline.