Refined ANSI Color code math.