Well, turns out this behavior is a feature, not a bug.
In the multiselect attribute's Storefront Properties is a setting "Use in Layered Navigation". Two two choices cause the attribute to be used in layered navigation. These are:
- Filterable (with results)
- Filterable (no results)
Evidently, selecting "with results", means that in Navigation this attribute's filter only shows attribute values which, if selected as a filter, would change the list of products shown. So Magento hides that value if there are zero items having that value. But Magento also hides that value if all the currently shown products have that value.
So that may make it easier for the user to choose filter values which will definitely whittle down the list. However it hides from the user the attribute values that the shown items have, suggesting that the filtered items lack those attribute values.
In the example I gave in the question statement, the user would think that the two products have only Blue or Green color schemes, and be unaware that these are Red-Green and Red-Blue schemes.
At any rate, the "Filterable (no results)" option will result in the corresponding Layered Nav filter showing all allowed values and their product counts, whether the value corresponds to zero, some, or all currently shown items.
I have not discovered a happy medium setting where Magento would hide filter values with zero hits, but show all other values.
Best Answer
There are many extensions out there that will give you this functionality (search for "enhanced layered navigation"). I have tried all of the extensions listed below but my favourite is by Ecommerce Team - I like it for its minimalistic nature, it doesn't try to do too much but is very powerful and works well out of the box. It also has support for color swatches like you described.
Some others in no particular order:
Be aware these may cause conflicts with other third party modules.
If you are mainly looking to do this with color swatches I suggest you check out this extension by Chad Morgan.
Here's an article by Inchoo about keeping the unused filters visible.
If you're looking to code this yourself then I think the answer to your question might be too long for this forum. I don't have a link to a blog post/tutorial teaching you how to do this but I suggest starting with extending the layered navigation blocks.