You can select the Paint Gun by pressing 'N'. It allows you to paint certain materials that are paintable, in any color you want. With the Paint Gun selected, LMB paints the targetted block, RMB opens the color selection window, and MMB samples the color from the selected block, if the selected block can be painted. The paint gun will display what color is selected on the gun itself.