Here is a quick guide on how to give any object or part of an object a gradient (or any pattern you want!).
I personally use Piskel for pixel art, and so this guide will be targeted towards Piskel users. If you use another program for pixel art, just know that you need some way to generate your gradient/pattern and some way to fill by same color.