In situ chemical analyzers with colorimetric detection