Start of color math stuff