Updated swatch getting algorithm.