So, after a lot of searching and reading I found a way of how to find the pixels linked to every colour of colormap. Based on that I can do a manual search for a specific colour.
Solution:
[I,map] = imread('image.png'); % 'I' is represented in uint8 and 'map' in double
figure
imshow(A,map); %Plot the image and its colormap
colorbar; %Show the colormap in the plot
ax = gca;
spectData = ax.Children.CData; %Generate a matrix (m-by-n) with the color in each pixel
Based on that I can now use loops or any other function instead of find() to find the pixels required based on its colour.
