That is fairly easy. Just create your rectangle shape, and apply a linear fill, going from gray to black (left to right).