This article explains how to create a custom gradient in GIMP version 2.10 for Windows, Mac, and Linux.
Easy way to create a custom gradient in GIMP
To access the GIMP Gradient Editor:
Go to Window > Dockable Dialogs > Gradients to open the Gradients dialog and view the full list of gradients pre-installed in GIMP.
Right-click anywhere in the list and select New Gradient to open the Gradient Editor.