the apex (or greatest depth if subtracting) is at the center (for a square) or along the longest axis (for a rectangle), which complicates modeling such geometry.
An alternate option is to have a pixel image of a gradient:
One thing to note, if you import an image into a shape, it will scale the image to fit the larger dimension of the shape. That is, it will FILL the shape with the image, and if not the same aspect ratio, parts of the image will outside the shape. The height you enter for the 3D component is the height of the entire image (Black → White), and in the case below what fits into the shape is something like 25% gray to 75% gray.
Good point — that makes it a bit less directly useful — guess you’d need to scale them asymmetrically to match the proportions of the geometry they were being imported into.