correct parsing of ColorMode and PrinterMode in the API (fixes #1757)