Fix calculations used in Color