In DirectX you can use a PositionColored vertex format to set the color of a given primitive. When rendered, the primitive displays the given colors at each vertex and interpolates the fill color based on the color values at each vertex. This is the simple approach. You can also use textured
coordinates, supplying an image that contains, for example, a color gradient, to produce a similar ...