We demonstrate a compact spectrometer system by using a gradient grating period guided-mode resonance filter - mounted on a linear photodetector array - that exhibits spatially dependent resonance characteristics; a specific incident wavelength is reflected such that the underlying array pixels measure minimum intensity. A precalibrated transmission efficiency matrix is used to determine each pixel's transmission efficiency for specific wavelengths. Unknown spectral information can be calculated from the measured intensity. Grating periods of 250-388 nm in 2-nm increments are used in each 100-cycle period. Device length is 2.23 mm. Spectral range of 506-700 nm is measurable with 1-nm resolution.