Text this: Miniature spectrometer based on graded bandgap perovskite filter