extracting duplicate color values into variables