remapGradients: changed type of parameter mask from bool to uint8_t (bool cause problems with clang-10).