The following snippet draws a gray square.

```
glColor3b(50, 50, 50);

glBegin(GL_QUADS);
glVertex3f(-1.0, +1.0, 0.0); // top left
glVertex3f(-1.0, -1.0, 0.0); // bottom left
glVertex3f(+1.0, -1.0, 0.0); // bottom right
glVertex3f(+1.0, +1.0, 0.0); // top right
glEnd();

```

In my application, behind this single square exists a colored cube.

What function should I use to make square (and only this square) opaque?
['https://Stackoverflow.com/questions/721705', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/47775/']
You can set colors per vertex

```
glBegin(GL_QUADS);
glColor4f(1.0, 0.0, 0.0, 0.5); // red, 50% alpha
glVertex3f(-1.0, +1.0, 0.0); // top left
// Make sure to set the color back since the color state persists
glVertex3f(-1.0, -1.0, 0.0); // bottom left
glVertex3f(+1.0, -1.0, 0.0); // bottom right
glVertex3f(+1.0, +1.0, 0.0); // top right
glEnd();

```
Use `glColor4` instead of `glColor3`. For example:

```
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
glColor4f(1.0f,1.0f,1.0f,0.5f);

```