Refactorizing Cuda Dominant Color and Thread Dominant Color