My solution is based on Highlight elements in the matrix. Indeed, one possibility here is to exploit matrices.
The code:
\documentclass[a4paper,12pt]{article}
\usepackage{xparse}
\usepackage{tikz}
\usetikzlibrary{calc,matrix,patterns,shadings,backgrounds}
\pgfdeclarelayer{myback}
\pgfsetlayers{myback,background,main}
\tikzset{myfillcolor/.style = {draw,fill=#1}}%
\NewDocumentCommand{\highlight}{O{blue!40} m m}{%
\draw[myfillcolor=#1] (#2.north west)rectangle (#3.south east);
}
\NewDocumentCommand{\vshade}{O{blue!40} O{white} m m}{%
\draw[bottom color =#1,top color=#2] (#3.north west)rectangle (#4.south east);
}
\NewDocumentCommand{\oshade}{O{blue!40} O{white} m m}{%
\draw[right color =#1,left color=#2] (#3.north west)rectangle (#4.south east);
}
\NewDocumentCommand{\inshade}{O{blue!40} O{white} m m}{%
\draw[inner color =#1,outer color=#2] (#3.north west)rectangle (#4.south east);
}
\NewDocumentCommand{\fillpattern}{O{north west lines} O{blue!50} m m}{%
\draw[pattern=#1, pattern color=#2] (#3.north west)rectangle (#4.south east);
}
\begin{document}
\begin{tikzpicture}
\matrix (m)[matrix of nodes, style={nodes={rectangle,draw,minimum width=3em}}, minimum height=3em, row sep=-\pgflinewidth, column sep=-\pgflinewidth,ampersand replacement =\&]
{
1 \& 2 \& 3 \\
4 \& 5 \& 6 \\
7 \& 8 \& 9 \\
};
\begin{pgfonlayer}{myback}
\highlight{m-1-1}{m-1-1}
\vshade{m-2-2}{m-2-2}
\vshade[white][red]{m-2-3}{m-2-3}
\oshade{m-1-3}{m-1-3}
\oshade[white][orange]{m-1-2}{m-1-2}
\inshade[orange][white]{m-2-1}{m-2-1}
\fillpattern{m-3-2}{m-3-2}
\fillpattern[dots][green!50!black]{m-3-1}{m-3-1}
\fillpattern[sixpointed stars][violet!50]{m-3-3}{m-3-3}
\end{pgfonlayer}
\end{tikzpicture}
\end{document}
The result is (please forgive my bad colors :)):

Some explanations
The basic idea here, as it is said before, is to exploit matrices, thus the first thing to do is to draw the grid around numbers. This has been achieved by the options style={nodes={rectangle,draw,minimum width=3em}}, minimum height=3em, row sep=-\pgflinewidth, column sep=-\pgflinewidth.
Each element is colored in background by means of the background library such that the coloring does not affect too much the number visibility (beware of the patterns that are a bit problematic).
On the bases of the result you want to achieve, you should use a different command:
\highlight is the most simple command and it colors the whole part;
\vshade allows to insert a vertical shading;
\oshade is the equivalent for the horizontal shading;
\inshade allows to achieve a radial shading;
\fillpattern inserts a pattern.
By means of TikZ matrices you can highlight an element by using the syntax name_matrix-row-colum: in our case an element could be m-1-1. All commands are designed to fill an area corresponding to (element.north west)rectangle (element.south east) and allow you to customize the coloring. Actually, it is even possible to select a bigger area, for instance two or more numbers; an example of this selection type could be:
\vshade{m-1-1}{m-2-2}
to color the correspondin areas of 1, 2, 4, 5.
For what concern the \fillpattern, you can even select which pattern style use (first optional argument) and its color (second optional argument).
The same result could be achieved by means of the fit library:
\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\usetikzlibrary{calc,matrix,patterns,shadings,backgrounds,fit}
\pgfdeclarelayer{myback}
\pgfsetlayers{myback,background,main}
\begin{document}
\begin{tikzpicture}
\matrix (m)[matrix of nodes, style={nodes={rectangle,draw,minimum width=3em}}, minimum height=3em, row sep=-\pgflinewidth, column sep=-\pgflinewidth,ampersand replacement =\&]
{
1 \& 2 \& 3 \\
4 \& 5 \& 6 \\
7 \& 8 \& 9 \\
};
\begin{pgfonlayer}{myback}
\node[fit=(m-1-1),fill=blue!40,inner sep=0cm]{};
\node[fit=(m-2-2),bottom color=blue!40,top color= white,inner sep=0cm]{};
\node[fit=(m-2-3),bottom color=white,top color= red,inner sep=0cm]{};
\node[fit=(m-1-3),right color=blue!40,left color= white,inner sep=0cm]{};
\node[fit=(m-1-2),right color=white,left color= orange,inner sep=0cm]{};
\node[fit=(m-2-1),outer color=white,inner color= orange,inner sep=0cm]{};
\node[fit=(m-3-2),pattern=north west lines, pattern color=blue!50,inner sep=0cm]{};
\node[fit=(m-3-1),pattern=dots, pattern color=green!50!black,inner sep=0cm]{};
\node[fit=(m-3-3),pattern=sixpointed stars, pattern color=violet!50,inner sep=0cm]{};
\end{pgfonlayer}
\end{tikzpicture}
\end{document}
\ShadeCellor\HatchedCell. In my original answer I exaplain how to use the command, but basically, if the text spans n lines (n>1) you need to use n-1 as the optional argument. – Gonzalo Medina Aug 14 '12 at 17:21pdfTeX error: pdflatex (file putr8a.pfb): cannot open Type 1 font file for reading. I'm afraid I have no idea how to debug this. What part of the solution causes this? I'd very much appreciate any pointers – Joost May 27 '13 at 19:37fourierfonts. Commenting out (or deleting) the line\usepackage{fourier}should solve the problem. If not, feel free to open a fresh new question as a follow-up to this one. – Gonzalo Medina May 29 '13 at 00:48