How to go about implementing a program to measure the "intensity"/"saturation" of a color in an image?
You can find mapping from RGB space to HSV here:
https://math.stackexchange.com/questions/556341/rgb-to-hsv-color-conversion-algorithm

For other spaces, you can refer to vision modelling textbooks, i.e: Digital video quality, Stefan Winkler