Add code to deal with color codes with 2<=n<=5