Structural colors are generated using waveguiding and diffractive effects in ordered silicon nanowire arrays. Tunable colors can be achieved by changing the angle of incidence. The generated colors are used for refractive index sensors with better than 1E-4 resolution resulting in low cost color sensor. Sensing uses a camera and detects changes by measuring changes in color. It does not use any spectrometers.