How you find the color depends somewhat on what format your image data is in. If it is a color image, it is likely to be a W x H x 3 matrix where W and H are width and height in pixels and the third dimension is RGB. Depending on the image format, there may also be alpha data or the colors may be something like CMYK.
The data may also be of different types. These are usually double, uint8, or uint16. In the case of the type double, the color intensity for a given pixel will be expressed as a number between 0 (black) to 1 (full intensity of whichever color you're looking at). If the data type is uint 8 or 16, the color intensities will be integers ranging from 0 to 255 or 65535 (for 8 and 16 respectively).
Once you know the data type and color format, you need to identify how the color you're looking for is expressed.
Ex. You are working with an RGB image in uint8 format and want to identify areas that are fully red with no other color. The color you're looking for is [255,0,0].
One way to identify these pixels is to do the following:
R = img(:,:,1) == 255;
G = img(:,:,2) == 0;
B = img(:,:,3) == 0;
RedPixels = R & G & B;
This can be modified to search for ranges of a color or to ignore particular colors:
R = img(:,:,1) > 235;
B = img(:,:,3) < 25;
will find pixels that are close to fully red and only contain a little blue but may have any value of green.