How do I change the colour / labels of individual elements in a layer?

This is controlled in the Mapserver map file layer entry.

Note: See http://mapserver.gis.umn.edu/ for more detail about what can be specified in a map file.

Two simple examples are given below:

Example 1

LAYER
	NAME "GTOPO 30 Antarctica"
	TYPE RASTER
	STATUS ON
	DATA "antarctica/dem/ANTARCPS.DEM"
	CLASS
		NAME "0 - 30"
		EXPRESSION ([pixel] >= 0 AND [pixel] < 30)
		COLOR 255 255 255
	END
	CLASS
		NAME "30 - 60"
		EXPRESSION ([pixel] >= 30 AND [pixel] < 60)
		COLOR 253 253 253
	END
...
...
END

With this entry, all components in the USGS ASCII DEM layer with a value between 0 and 30 would be coloured white, all those with a value of 30 to 60 would be almost white, etc.

Example 2

LAYER
	NAME "Arctic Bathymetric (IBCAO)"
	TYPE RASTER
	STATUS ON
	DATA "arctic/ibcao/IBCAO_arcinfo/ver1_polar/hdr.adf"
	CLASS
		NAME "-5600 - -5550"
		TEXT "-5600 - -5550"
		LABEL
			COLOR 33 33 66
			SIZE medium
			POSITION auto
		END
		EXPRESSION ([pixel] >= -5600 AND [pixel] < -5550)
		COLOR 0 0 0
	END
	CLASS
		NAME "-5550 - -5500"
		TEXT "-5550 - -5500"
		LABEL
			COLOR 33 33 66
			SIZE medium
			POSITION auto
		END
		EXPRESSION ([pixel] >= -5550 AND [pixel] < -5500)
		COLOR 0 0 10
	END
...
...
END

This entry would take the Arc/Info Binary Grid (.adf) vector data and would label and colour regions based on pixel value.