Today I came across this article, which shows how to create a desktop background with a color gradient in GNOME:
For a vertical gradient:
gsettings set org.gnome.desktop.background color-shading-type 'vertical'
For a horizontal gradient:
gsettings set org.gnome.desktop.background color-shading-type 'horizontal'
Remove the wallpaper images for light and dark mode and set the background picture to none:
gsettings set org.gnome.desktop.background picture-uri ''
gsettings set org.gnome.desktop.background picture-uri-dark ''
Then set the two colors (more colors are not possible by default, you would need to create a image in an image editing tool if you like a gradient of more than two colors or other gradients (radial, conic) or to set an angle). You can use HEX codes or color names (I used lightgreen and purple on my screenshot), for example:
gsettings set org.gnome.desktop.background primary-color '#fff000'
gsettings set org.gnome.desktop.background secondary-color '#ff0000'
or
gsettings set org.gnome.desktop.background primary-color 'yellow'
gsettings set org.gnome.desktop.background secondary-color 'red'
To set a single color instead, use
gsettings set org.gnome.desktop.background color-shading-type 'solid'
Remove the both images for light and dark mode as shown above, and then set only the primary color.
To undo it and go back to a background image, just select a background image in the normal settings app or right-click on the desktop and select "change background".



