I got this idea from this thread:
Creating svg gradients for GimpI thought why not make methods that allows user to create .svg gradients for gimp gradients without having to look at or edit the text file manually.
So here it is (release 8):
Attachment:
svg-gradients.zip [3.29 KiB]
Downloaded 252 times
Release 8 Notes: Changed to use os.path.join() instead of hardcoding slashes so that it'll work on different OSes (as suggested by Dinasset).
Release 7 Notes: No function change. Changed code a little so that gradient_folder is defined in one place instead of 4 places.
Release 6 Notes: Missed a spot where i didn't change to forward slash so just putting that in there.
Release 5 Notes: changed backward slashes of directories (\\) to forward slashes (/) so that it might work for Linux (asking Rich to test for me in Linux) because I am on Windows and forward slashes still work on Windows).
Release 4 Notes: Moved the 3 functions to <Gradients>/SVG/
Access by right clicking on a gradient which i think is friendlier since for Adding Stop and Deleting range now you don't have select a gradient because it'll apply to the gradient that you've right clicked on.
Release 3 Notes: previous releases followed the original thread format which creates valid svg gradient files but not valid .svg image files.
This release makes valid svg file so svg gradient files can be opened in GIMP as image as well if desired.
Note: If you have svg gradients created by earlier releases, you'll have to add a stop or delete a range which could just be a range that includes no existing stops to make the .svg files valid .svg files so that they can be opened as image)
There are 3 methods registered under <Gradients>/SVG/ (access this by right clicking a gradient will only work with created SVG gradients)
As you can see below,
1. New...
2. Add a Stop...
3. Delete Stops within Range...
Hopefully the names are self explanatory.
Here are options windows for the 3 methods
1. New... - Creates a new gradient with gradient name and stop color at 0% offset and stop color at 100% offset with specified opacity as well. (Note: if Gradient name already as exists as .svg file, it'll overwrite so you could use it to quickly overwrite an existing SVG gradient that you've created).
2. Add a Stop - Adds a stop color to offset at percentage with specified color and opacity to an existing/right-clicked SVG gradient.
3. Delete Stops within Range - Delete all stops within the specified range of an existing/right-clicked SVG gradient, if 0 and 100 is specified as range all stops will be deleted but then i put in a placeholder stop at 0% so that the svg is a valid gradient.
Please try it out and let me know what y'all think.