color calculation added