> For the complete documentation index, see [llms.txt](https://machinations.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://machinations.gitbook.io/docs/nodes-properties/filter-diagrams.md).

# Filter (Colour Coding)

create distinct Resource Types

Machinations uses a **colour Filter** to set rules for how Resources flow.&#x20;

{% hint style="warning" %}
Filters apply to individual Elements and Structures, not globally, per diagram.
{% endhint %}

![](https://2667914601-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGZcALyOGDKb9q0wdJ5%2F-MMH9WTyXcjK25kOZkNm%2F-MMLZ9MxlDd-ugSEMOG5%2Fimage.png?alt=media\&token=d1099b1e-0f0d-4b40-a801-d41aa66cadb6)

This function can be activated in the Resource Connection's Properties menu. A Resource Connection for which the Filter has been activated, will only transfer Resources whose colour matches the filter's. Select the filter colour in the dropdown to its right (see above).

{% hint style="danger" %}
In structures that use Filter:

1. The colour set for each **Source & Drain** will determine the type/colour of Resource they produce/ consume.
2. **Resource Connections** use colour to determine which Resources they transfer.
3. **State Connections** will respond to Resources based on their colour.

You can set the colour of the Resource in the `Properties menu` for each Node.

<img src="https://2667914601-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGZcALyOGDKb9q0wdJ5%2F-MMH9WTyXcjK25kOZkNm%2F-MMLbVQo9gHEUeiUeVLI%2Fimage.png?alt=media&amp;token=47ff61e9-01ee-4a39-af80-8d6d89ffe0fa" alt="" data-size="original">&#x20;
{% endhint %}

### Connections, Sources, Pools, Drains

:wrench: In the video example below, we have showcased the same diagram in 3 states:

1. **Not Colour Coded**
2. **Colour Coded**: the Drain pulls through both Resource Connections,. The rule of how Resources flow towards the Drain is being set through the Filter colour.
3. **Colour Coded with flow interruption**: Notice how when we change the type of Resource one of the Connections may accept, the flow changes and the Blue Resources are being stacked in the Pool.

<div align="left"><img src="https://2667914601-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGZcALyOGDKb9q0wdJ5%2F-MMH9WTyXcjK25kOZkNm%2F-MMLjYpCXmiFAbHN_NPz%2FScreen%20Recording%202020-11-17%20at%2005.06%20PM.gif?alt=media&amp;token=67f40ceb-29a6-4841-b06b-1ea88f40e9a2" alt=""></div>

### Colour Coding versus Diagram Elements Colours

You can use colour to emphasise or to distinguish different elements on your diagrams, without this affecting the flow of Resources.

:wrench: Watch the gif below for such an example. On the same diagram example used before, with Colour Coding active, we change the colour of the Resource Connections on the top branch. Notice this type of change has no effect on the Resource flow.

<div align="center"><img src="https://2667914601-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGZcALyOGDKb9q0wdJ5%2F-MMH9WTyXcjK25kOZkNm%2F-MMLkXjT5ZC3ZZVT-sUR%2FScreen%20Recording%202020-11-17%20at%2005.10%20PM.gif?alt=media&amp;token=5633a619-37cc-44a2-963b-c8395016703a" alt=""></div>
