Actively variable-spectrum optoelectronics with black phosphorus