Color Gradient - Paint operators

I can’t seem to find the file where the color gradient script is stored for weight paint.
I would like to see if I can use it for vertex paint.

I want to take a look at the script and refer to that page to get an idea how to write it. Very new to script…