pre-allocate matrix in .get_color