Color Gradient script?

 From:  Frenchy Pilou (PILOU)
9676.46 
@ Michael How gradient numbers colors itselve are made following the path ?
Following the number of objects selected or following an arbitrary number (eg 100) ?

EDITED: 11 Feb 2020 by PILOU