How to do smooth shading using my own color set

I need to fill a triangle, but i do not want to use the method supplied by opengl, which is: specify a color value of the vertex and put the pixel, opengl will do all the things. My problem is that: if i have specified the color of each three vertex, i need to fill the inner part use my own color table, say 1024 color entries. For example, if vertex 1 is color 012, vertex is color 500, then i need to fill the pixel between them using the color from 012 to 500 in my color table, not the one that calculated by opengl. how can i implement it?

I want to do something similar. Smooth shading does not do the trick. Have you solved the problem? Have you tried Color-Index Mode? What about 1-D texture? Thanks.

Use a 1D texture for this.

To specify a color you use a texture coordinate.

If you need multiple terms you can use 2D or even 3D texture if you have it.