What do you do with the document afterwards? Maybe it's enough to set the color in the object (widget?) used as a container for the document?