add hex color feature and some refactoring