The Puritan community sees Hester as a fallen woman, Dimmesdale as a saint, and would have seen the disguised Chillingworth as a victim — a husband betrayed. The Puritan kids are taught to contemn Hester for her criminal conversation.
Its meaning then becomes indefinite. Thus, using his characters as symbols, Hawthorne discloses the grim underside of Puritanism that lurks beneath the public piety.
Sin and its acknowledgment humanize Dimmesdale. Black and gray are colors associated with the Puritans, gloom, death, sin, and the narrow path of righteousness through the forest of sin. She is the scarlet letter in the flesh, a reminder of Hester's sin. The same is the case of Chillingworth. But, similar to the characters, the context determines what role the light or colors play.
The scarlet letter was her passport into regions where other women dared not tread. When Dimmesdale confesses his sin in the light of the sun, Pearl is free to become a human being. The prison door is a symbol of punishment given to the culprits and jail inmates for their crimes.
But Pearl reminds her mother that the sun will not shine on the sinful Hester; it does shine, however, when Hester passionately lets down her hair.
It means it is a symbol of cover. I feel the symbolism helps to associate a state of affairs to a place the reader knows about.