Filter by multiple categories
Craft's relatedTo takes a model, an ID, or an array of either of these. So if you're passing '171,172,179' It's probably coming through as a string and only reading the first ID.

Try making it an array and looping through the values:

{% set catPars = craft.request.getParam('cats')|split(',') %}
{% set related = ['and'] %}
{% for catPar in catPars %}
    {% set related = related|merge([{targetElement: catPar}]) %}
{% endfor %}


{% set swatches = craft.entries({ section: 'swatches', relatedTo: related }) %}


Without knowing your setup I don't know if it's actually targetElement or sourceElement. You can also pass in the field name as well if you want to get more specific. See the documentation linked above for the definitions of all of those.