refactored r1,g1,b1 r2,g2,b2