Unify some duplicated code.

All three places that affect the persistent
color button now call a single function.