Nonequilibrium thermodynamics of colloidal systems