A unique color is some color with some unique value, but colors can be represented in different data formats which have than some different "color rooms".
In my heyday the colors were 1, 2 or 3 byte which translates to 8, 256 or 16,7 mio colors. The later 4th bit is some transparency value. So some basic knowledge about bits and bytes and the operators is helping to work with colors.
So read the
wikipedia for some theory. See also the links after the article.
And when interesting in code than I recommend the outstanding
CXImage article.