add some color functions, share more code (implementation)