reduce code in color class