The First tower hat is given to you by a rune guardian during the Rune Mysteries quest. It is part of the First tower robes set. The colour of the hat is determined by the result of the test during the quest. You can take the test again to change the hat to a different colour.
The colours available are: