We have presented an RGB optical filter, based on photonic crystal (PhC) waveguides, with the hexagonal arrangement of GaP rods in air. It filters out the three primary colours of the visible range, red (R, λ = 648 nm), green (G, λ = 540 nm) and blue (B, λ = 470 nm). The plane wave expansion method is applied for estimating the dispersion curves and finite element method is utilized in examining the propagation characteristics of the designed PhC-based optical filter. Transmittance, extinction ratio and tolerance analysis have further been calculated to confirm the performance of the proposed optical filter to work in the visible range of optical spectrum and filter out the three primary colours (red, green, blue) along different output ports.