color calculation