There is a Color-Index mode to openGL that allows you to build your own color palette, although I'm not sure why you would want to use it, I think it was generally designed for ancient cards that only had like 8-bit color or something.
If you're still interested in building a palette versus just sending the colors, than you can check out this link which should explain how to use it
RGBA versus Color-Index Mode Although be warned that it says RGBA mode works better with lighting, shading, fog, antialiasing, and blending, and that was back in version 1.1, so I have no idea what support for that mode is like now.
Quote:
Surely drawing 1000 rectangles is wrong way to do this, what should I be doing?
Not necessarily. If you want to make a quad that has 1000 little different color squares on it, then you need to either build a texture, or render 1000 tiny quads. If you render these quads properly (NOT using glBegin), your gpu can probably handle this easily at well over 60 fps.
If you want to render all those quads, then you should eventually try to learn the proper way to render (VBOs), as this would probably be 50+ times faster than drawing it with glBegin (which is very very slow). glBegin immediate mode is probably ok when you're just starting out as a beginner, but it will get you nowhere once you try to start doing anything complicated (and its depreciated).