Europeans referred to East Asians as white until the end of the 18th century. But as the Chinese and Japanese resisted cultural assimilation they darkened – both in Western eyes and their own