The smallpox god was colored a deep red and green, so similar things like this were used as wards and offerings to it.
Although, given that they've drifted to Gensokyo, their function against smallpox must've ended a while ago, but...
A long time ago, Hachijou-jima was said to have no smallpox due to the samurai Chinzei Hachirou Tametomo defeating its smallpox god.