As far as I remember, there are two colors for these numbers: RED when you get hit by someone / YELLOW when you get hit by some effect (poison...)
You cannot change the behaviour or color since it is hardcoded inside the client
You can, however, simulate this by sending an overhead message but will not look the same