Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: 3D Graphics Programming With QuickDraw 3D /
Chapter 21 - QuickDraw 3D Color Utilities / QuickDraw 3D Color Utilities Reference
Data Structures


Color Structures

You use an RGB color structure to specify a color. The RGB color structure is defined by the TQ3ColorRGB data type.

typedef struct TQ3ColorRGB {
   float       r;             /*red component*/
   float       g;             /*green component*/
   float       b;             /*blue component*/
} TQ3ColorRGB;
Field Description
r
The red component of the color. The value in this field should be between 0.0 and 1.0.
g
The green component of the color. The value in this field should be between 0.0 and 1.0.
b
The blue component of the color. The value in this field should be between 0.0 and 1.0.
You use an ARGB color structure to specify a color together with an alpha channel. The ARGB color structure is defined by the TQ3ColorARGB data type.

typedef struct TQ3ColorARGB {
   float       a;             /*alpha channel*/
   float       r;             /*red component*/
   float       g;             /*green component*/
   float       b;             /*blue component*/
} TQ3ColorARGB;
Field Description
a
The alpha channel of the color. The value in this field should be between 0.0 (transparent) and 1.0. (solid).
r
The red component of the color. The value in this field should be between 0.0 and 1.0.
g
The green component of the color. The value in this field should be between 0.0 and 1.0.
b
The blue component of the color. The value in this field should be between 0.0 and 1.0.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996




Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help