how to use glReadPixels for a single pixel

Im wanting to store the RGB value, in three seperate variables, of the pixel on the screen where the mouse was clicked. Presumably the best way to do this is use glReadPixels. Could anyone give me a couple of lines of code I could use to store the RGB. Thanks.

float color[3];
glReadPixels(x, y, 1, 1, GL_RGB, GL_FLOAT, color);

In opengl the y-axis is reversed, so you have to set
y=(height of the window’s client area)-y;