Removed hard-coded list of color names; compute from element instead

This is likely slower than the look-up table, but it saves several kb in JS code.
It is unlikely that it will make much difference in practice, since it would not
be very useful to animate smooth transitions by cycling through color names.