I am trying to click a picture of an image projected by a projector with a Nikon DSLR camera. But whenever I click the picture there are weird colors all over the captured image? How can I stop that? Thanks.
Use a shutter time longer than the length it takes the projector to do a full scan. For most cases, this would be at either 1/60 or 1/30 second. In order to use shutter times that long, you may need to stabilize the camera to prevent blurring from camera movement and close down the aperture and/or reduce the ISO to prevent overexposure.
While M. Clarke's answer is correct, it implies that the projector scans, i.e. it has a DLP and a color wheel, and it outputs field-sequential colors. You can easily verify this by moving your eyes rapidly and observing the color breakup (R,G,B colors) on bright edges. GIYF.
3-LCD projectors don't have this problem, but they are in a higher price class. 3-DLP digital cinema projectors also don't, but there you might capture the subfields, just like with plasma TV panels. In all those cases a long shutter time is recommended, i.e. n/60 (or n/50 or n/24) sec.
Similar problems may occur when shooting under fluorescent or LED light that flickers at 100 or 120 Hz, especially when you shoot movies at 30,60 or 25,50 fps respectively. Since the DSLR has a rolling shutter, you may see bands. Again, shutter slower or at a multiple of the flicker period: n/120 in 60 Hz countries, n/100 in 50 Hz countries. You want to capture integer flicker cycles. Now you know why cameras are available with both frame rates.
It's fun to shoot a high frame rate movie to observe the behavior of displays or lights, but otherwise it's often unusable.