drawing from 256 color scheme

Dear All
Regards!
I want to draw a drawing and want to set the color of the drawing from possible 256 color scheme.
how i set while writting program in opengl, if i want to set a particuler color e.g 40th color scheme from the color array.

help needed in this regard

thanks and regards.
David

well, store your 256 RGB colors in an array, and use the 40th color triplet for glColor before you draw.

Even if there is some indexed mode support in OpenGL, it is quite deprecated.

how i set in OpenGL if the 40th index has the RGB value=RGB(255,191,0)in array, can i set it using GLColor3f() or any other function of openGL.
please write these programming lines for me.
kindly guide me, i m a child in OpenGL world.

how i set in OpenGL if the 40th index has the RGB value=RGB(255,191,0)in array, can i set it using GLColor3f() or any other function of openGL.
please write these programming lines for me.
kindly guide me, i m a child in OpenGL world.

glColor3ub(255,191,0);