refactoring on ColorDialog