make color test in inifinite loop

Signed-off-by: Yen-Chin Lee <coldnew.tw@gmail.com>
reduce main function complexity

Signed-off-by: Yen-Chin Lee <coldnew.tw@gmail.com>