Tomorrow is a big event at my university. I’d like to make a fun thing where the people of the Board Game society I am in can try to find me for a riddle, kind of a Where is Waldo in a place where there is a crap tone of people to find the NPC that’ll give them a Riddle (Maybe something to win? No idea how I could do that detail)
Let’s number the dudes in your image form left to right: 1, 2, 3 and 4.
Dudes 3 and 4 have no useful information. They stay silent.
Dude 1 can see one of each hat colour on the dudes in front, but cannot determine their own colour without knowing the hat colour of dude 4. They stay silent.
Dude 2 can see the hat colour of dude 3. They can determine that either they themself or the dude behind must have a different hat colour. The dude behind - dude 1 - can see both of the hat colours in front, but stays silent. This lets dude 2 know that they and dude 3 must be different colours (otherwise dude 1 would have known their own hat colour).
Therefore, dude 2 knows their own hat colour must be different to the dude in front and announces the colour of their own hat.
That’s correct!