refactor dialog color and remove all warnings