Graphics Reference
In-Depth Information
Fill style. This attribute defines if the interior of the triangle should be
filled. When switched to wire-frame mode, only the outline edges of the
triangles will be drawn.
Wire frame. Draw the out-
lines of the primitives, leaving
the interior unfilled.
7.2
Working with Color
Typically, color is expressed as a (red,green,blue) triplet (or
(
r
,
g
,
b
)
).
We refer to
Normalized number. This
is a floating-point number de-
fined between 0
each of the red, green, and blue as a color channel, or a color component. Each of
the color components is defined either as a normalized floating-point number:
0. For
example, the number 1 . 2 is not
a valid normalized number.
.
0and1
.
0
.
0
r
,
g
,
b
1
.
0
or as an integer:
0
r
,
g
,
b
255
.
In either case, the minimum number represents no intensity for the corresponding
component, and the maximum number represents full intensity. For example:
0x00FF0000. This is a hex-
adecimal number where each
digit can be between 0 and F
(15).
Color
Floating point
Integer
Packed unsigned integer
white
( 1 . 0 , 1 . 0 , 1 . 0 )
( 255 , 255 , 255 )
0x00FFFFFF
(
.
,
.
,
.
)
(
,
,
)
red
1
0
0
0
0
0
255
0
0
0x00FF0000
green
(
0
.
0
,
1
.
0
,
0
.
0
)
(
0
,
255
,
0
)
0x0000FF00
blue
( 0 . 0 , 0 . 0 , 1 . 0 )
( 0 , 0 , 255 )
0x000000FF
black
( 0 . 0 , 0 . 0 , 0 . 0 )
( 0 , 0 , 0 )
0x00000000
The maximum intensity of the integer representation is limited to 255 and can
be represented by an unsigned 8-bit integer. A packed unsigned integer packs
the three 8-bit integers into bit positions of a 32-bit unsigned integer. This is a
compact way to represent color. The limited and discrete range of 256 (or 2 8 )
intensity levels of the integer representation reflects the capability of a typical
graphics device. The underlying hardware elements of a typical graphics device
are capable of displaying 256 distinct shades for each of the three colors. For this
reason, these types of graphics displays can display a total of
2 8
2 8
2 8
2 24
×
×
=
16 million unique colors.
Search WWH ::




Custom Search