here is the guts of a recent script I wrote to find the closest color in an image to a reference color, then create two labeled swatches appended side-by-side. See nearest color at http://www.fmwconcepts.com/imagemagick/index.html
This is the part that creates the labeled and appended swatches.
convert \
\( -background "$rcolor" \
-fill $labelcolor -font $fontname -pointsize $point \
-gravity northwest label:"Reference Color:\n\n\n$rcolor" \) \
\( -background "$mcolor" \
-fill $labelcolor -font $fontname -pointsize $point \
-gravity northwest label:"Nearest Color:\n\n\n$mcolor" \) \
+append $outfile
This should get you started in the right direction.
see Anthony's excellent pages (esp text to image) at http://www.imagemagick.org/Usage/