[ Previous | Next | Contents | Glossary | Home | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

c Subroutine

Purpose

Sets the current color in RGB mode.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

3-D 4-D
Int16 void c3s(Int16 vector[3]) void c4s(Int16 vector[4])
Int32 void c3i(Int32 vector[3]) void c4i(Int32 vector[4])
float void c3f(float vector[3]) void c4f(float vector[4])

FORTRAN Syntax

3-D 4-D
INTEGER*2 SUBROUTINE C3S(vector) INTEGER*2 vector(3) SUBROUTINE C4S(vector) INTEGER*2 vector(4)
INTEGER*4 SUBROUTINE C3I(vector) INTEGER*4 vector(3) SUBROUTINE C4I(vector) INTEGER*4 vector(4)
FLOAT SUBROUTINE C3F(vector) REAL vector(3) SUBROUTINE C4F(vector) REAL vector(4)

Description

The c subroutine changes the current RGBA (red, green, blue, alpha) color. Array components 0, 1, 2, and 3 are red, green, blue, and alpha, respectively. In the three-component cases, alpha defaults to 1.0 (float) or 255 (integer).

Floating-point components range from 0.0 through 1.0. Integer components range from 0 through 255.

Note: This subroutine is available only in RGB mode.

Parameter

vector Specifies, for the c4 subroutines, a four-element array containing RGBA (red, green, blue, and alpha) values. For c3 subroutines, a three-element array containing RGB values.
Array components 0, 1, 2, and 3 are red, green, blue, and alpha respectively. Floating point RGBA values range from 0.0 through 1.0. Integer RGBA values range from 0 through 255.

Example

The example C language program cylinder1.c calls the c3f subroutine, with a three element array initialized with all zeros as the vector parameter, to clear the screen to black.

Files

/usr/include/gl/gl.h Contains C language constant and variable type definitions for GL.
/usr/include/gl/fgl.h Contains FORTRAN constant and variable type definitions for GL.

Implementation Specifics

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.

If your system does not have alpha bitplanes, set the alpha values to zero.

Related Information

Setting the current color in color map mode with the color subroutine.

Specifying RGBA color with a single packed 32-bit integer using the cpack subroutine.

Returning the current color in RGB mode with the gRGBcolor subroutine.

Setting the current color in RGB mode with the RGBcolor subroutine.

AIX Graphics Library Overview, Setting Drawing Attributes, Understanding the Hardware Used by GL, and Working in Color Map and RGB Modes.


[ Previous | Next | Contents | Glossary | Home | Search ]