I'm not absolutely sure, but DustJS doesn't support this use case.
Since it's a templating engine, I guess they encourage you to expose plain data in your model and avoid such kind of logic in the template itself.
You might split your model as follows:
- redProjects
- greenProjects
- yellowProjects
And then you won't require DustJS syntax to get this working!