Masking to paint patterns, gradients on a single surface WITHOUT splitting it into pieces

Is there a way to apply paint colors in a pattern to a surface with a mask?
Is there a way to transition from one color at the bottom to another color at the top similar to the gradient tool in Photochop?

Trimming the surface has many unpleasant side effects down the pipeline…