how to apply "multi alpha"

i need to call some opengl functions like below:

  
  
glBegin(GL_QUADS);  
  glColor4f(1, 1, 1, 0.3 *topAlpha); glTexCoord2f(0, 1); glVertex3f(-235, 166, 600);  
  glColor4f(1, 1, 1, 0.0); glTexCoord2f(0, 0.75); glVertex3f(-235, 266, 600);  
  glColor4f(1, 1, 1, 0.0); glTexCoord2f(1, 0.75); glVertex3f(235, 266, 600);  
  glColor4f(1, 1, 1, 0.3 *topAlpha); glTexCoord2f(1, 1); glVertex3f(235, 166, 600);  
glEnd();  
  

is there any way that can let me change the code to some opengl calls like below??

  
  
glColor4f(1, 1, 1, topAlpha);  
glBegin(GL_QUADS);  
  glColor4f(1, 1, 1, 0.3); glTexCoord2f(0, 1); glVertex3f(-235, 166, 600);  
  glColor4f(1, 1, 1, 0.0); glTexCoord2f(0, 0.75); glVertex3f(-235, 266, 600);  
  glColor4f(1, 1, 1, 0.0); glTexCoord2f(1, 0.75); glVertex3f(235, 266, 600);  
  glColor4f(1, 1, 1, 0.3); glTexCoord2f(1, 1); glVertex3f(235, 166, 600);  
glEnd();  
  

it is just an opengl question… tks :smiley:

Short answer: no.

Long answer: if you’re going to have different colors (and color4f includes alpha) at each vertex you need to declare the color at each vertex. It’s not cumulative like a matrix stack transform.

:o
tks, and it seems i needs to store an extra alpha value.