They already used TokenStream for parsing the function parameters, but
this makes the `parse_foo_gradient()` functions themselves take a
TokenStream.
(cherry picked from commit 9de73bf89b061d6f168f7c1c3278e8f203959b3a)
This lets us remove the color/dimension-parsing lambdas, since these
always forwarded to the same methods. This will make it easier to later
convert those methods to take a TokenStream.
Avoid unintentionally converting between float and double multiple times
by just using double everywhere. Also, remove the unused `int` versions
of their constructors.