Creating a gradient mesh

Creating a gradient mesh is fairly intuitive once you grasp the basics. So let’s get started by colouring a simple tomato via a gradient mesh.

The path that will become a tomato.

Begin by drawing the shape of your tomato as a single closed path with the Pen, Pencil, or shape tools.

Choose a base color for the tomato, and fill the path with that colour. You can pick any colour you like, but for reference I started with RGB: 185, 44, 7.

With the tomato path selected, choose Object->Create Gradient Mesh. You will see the Create Gradient Mesh dialog.

Because a gradient mesh is a grid, when converting a path to a gradient mesh object, you must initially divide the object into expected areas of colour -- you can add and remove rows and columns later. At each intersection of column and row lines within the grid is a mesh point, which behaves very much like -- and may be called on your screen -- an anchor point, which controls the direction and curvature of path segments emanating from it. The difference is that a mesh point can also hold a colour value, and that is the whole point of a gradient mesh. Colours transition between mesh points. For instance, in a 2-by-2 black mesh, colouring the centre mesh point white will create a smooth gradient from that centre point outward in all eight directions -- up, down, left, right, and toward each of the four corners.

A basic 2-by-2 gradient mesh with the
centre mesh point coloured white and
all others coloured black.

In the Gradient Mesh dialog, choose a suitable number of starting columns and rows. How many you start with depends on the size and shape of your tomato or other object. You want enough rows and columns to easily colour the tomato with light, shadow, and different surface colours, but you always want sufficient space between columns and rows that colours will transition smoothly rather than sharply. The further away two mesh points are, the smoother and more subtle the change between their respective colours; the closer two mesh points are together, the sharper the colour transition.

Turn on Preview (if it is not already on) and notice that the mesh lines, which comprise the grid, are not perfectly horizontal and vertical; they adapt to the shape of the object defined by its outer path. Thus dimensionality is often already infused into the gradient mesh object.

To follow my lead, begin with 8 rows and columns. Appearance should be Flat and the Highlight 100 percent. Click OK.

The path converted to an 8-by-8
gradient mesh object.

The tomato is now a gradient mesh object, with all the mesh points selected (notice that they’re filled or selected rather than empty points). Switch to the white arrow Direct Selection tool and individually select a mesh point, and then change its colour by choosing a swatch from the Swatches panel or mixing a new colour from the Color panel. To give the tomato its first highlight, select a mesh point near the top left and colour it white. If the highlight you get is too small, colour other mesh points around the first white.