• Keine Ergebnisse gefunden

RASTER GRAPHICS

Im Dokument 4110 SERIES HOST PROGRAMMERS (Seite 83-88)

Selecting Color Coordinate Systems

RASTER GRAPHICS

Figure 8·9. The Effect of Changing the Color Map.

4110 SERIES HOST

8·11

RASTER GRAPHICS

The HLS System. You can visualize the HLS system by looking at the color cone in Appendix D. A particular color is a point in the volume of the cone defined by hue, lightness, and saturation. Figure 8-10 illustrates the HLS system color cone.

Hue is the angle formed by rotating a vector around the axis of the double ended cone with blue as the reference. Hue is the basic sensation we think of as color. A hue of 0° (or 360°) corresponds to blue, 120° to red and 240° to green,

with intermediate shades corresponding to intermediate ro-tations. You specify hue as an integer in the range -32768 to +32767 degrees. Integers less than 0 or more than 359 are converted to the range 0 to 359 by a modulo function.

Lightness is the position of a vector along the axis of the cone. Lightness is how bright or dull a color appears; it is how much light is emitted by the color. A lightness of 0% is black and a lightness of 100% is white. (At lightness 0% or 100%, saturation and hue are irrelevant.) You specify light-ness by an integer percentage in the range 0 to 100%.

Figure 8-10. The HLS System Color Cone.

8-12 4110 SERIES HOST

()

(\

Saturation is the radial distance of the vector from the cone axis. Saturation is the intensity of a color. A saturated color is very intense, while a less saturated color is one that ap-pears grayed or muted. A saturation of 0% is simply a shade of gray, while a saturation of 100% gives the most intense possible color having that hue and brightness. You specify saturation as an integer percentage in the range 0 to 100%.

The H LS system is the default system for the 411 0 Series color raster display terminals. The HLS system gives a good intuitive "feel" for a programmer or operator when attempt-ing to specify colors. HLS allows you to specify approxi-mately 3,600,000 colors.

The RGB System. The RGB system, also called the additive color system, defines colors as mixtures of the three additive color primaries: red, green, and blue. You specify colors in the RGB system as integer percentages from 0 to 100%.

" "

RASTER GRAPHICS

For example, you can define various shades of yellow by mixing equal amounts of red and green with a smaller amount of (or no) blue. You control the overall brightness of the color with the brightness of the primaries you use.

More specifically, a yellow with the proportions (90,90,0) is much brighter than a (30,30,0) yellow, while a (100,100,20) yellow is a still brighter washed-out light yellow.

In additive color mixing, adding equal amounts of the three primaries gives a gray. (50,50,50) is a medium gray, (20,20,20) a dark gray, (100,100,100) is white, and (0,0,0) is black.

You can visualize the color space defined by the RGB sys-tem as a cube. The three axes are the three primaries, while the origin is black. Each color is a volume within the RGB color cube. Figure 8-11 shows the RGB color cube.

, , , ---I 1 - - -

--

MAGENTA-r--(100,0,100)

I I

I _~~~I

I~ I

GREEN

I ~O,100,0)

I~"

1 "

I "

I I

Figure 8-11. The RGB Color Cube.

4110 SERIES HOST 8-13

RASTER GRAPHICS

Machine RGB in the 4115. The 4115 terminal is capable of 256 intensities for each color gun. To specify all the colors that the terminal can display, you can use Machine RGB as the color-specifying mode. Machine RGB allows you to specify 2563 (over 16 million) different colors.

The CMY System. The CMY system, also called the sub-tractive color system, defines colors as a mixture of the three subtractive primaries: cyan, magenta, and yellow. As in the RGB system, you specify colors with an integral percent (from 0 to 100) of the three primaries.

In the CMY system, adding a greater percentage of a pri-mary reduces the lightness of the displayed color. The gray scale in CMY is the range of equal mixtures from (0,0,0) to (100,100,100) for white to black. Figure 8-12 shows a color cube for the CMY system analogous to the RGB color cube.

, ,

Gray Levels. The number of different shades of gray that a terminal can display is limited by the terminal hardware. The 4112, for example, can display 15 distinct levels of gray, while the 4113 can display 16 levels and the 4115 can dis-play 256.

You can cause a color terminal to operate only in gray levels with the third parameter of the SET-COLOR-MODE com-mand. When you are operating only with gray levels, it is more efficient to use the shorter gray-level commands to define color indices and background levels.

Color Interaction on Overlaying Surfaces. When you have colors from different surfaces that overlap on the screen, you can control the color of the area where they overlay.

You can choose the color mix of that area to be opaque, additive, or subtractive.

, , 1 - - -

...--, ----I

GREEN

-y---(100,0,100)1

1/t::Jct-"~ I

C':J.~t-

1

I I

MAGENTA

1 ~,(0,100,0)

1"""---" "

1 "

1 "

1

1

Figure 8-12. The CMY Color Cube.

8-14

4110 SERIES HOST

(

(

c

If you define the color mix between different surfaces as opaque, a colored area on a surface with a higher surface display priority completely replaces any area on a surface with a lower surface display priority that intersects it.

If you define the intersurface color mix as additive, overlayed colored areas from different surfaces will mix by addition, as in the RGB system.

If you define the intersurface color mix as subtractive, the intersection of colored areas from different surfaces will mix by subtraction, as in the CMY system.

When you define colors as either additive or subtractive, the intersection of two overlayed colors may result in a color that is not in the color map because the mixture is

per-RASTER GRAPHICS

formed by the hardware between the color map and the display guns.

For example, Figure 8-13A shows two figures with the inter-section shaded. Shape A is red, (100,0,0) in RGB. Shape B is green, (0,100,0) in RGB. Shape A is on Surface 1 with surface display priority 1 and Shape B is on Surface 2 with surface display priority 2.

Figure 8-13B shows that, with opaque color interaction, Shape A obscures a portion of Shape B.

Figure 8-13C shows that, with additive color interaction, the intersection of the shapes becomes yellow.

Figure 8-13D shows that, with subtractive color interaction, the intersection of the shapes becomes black.

Figure 8-13. Interaction of Colors on Different Surfaces.

4110 SERIES HOST 8-15

RASTER GRAPHICS

Background Colors

Although Index 0 is the erase index, you use it with the SET-SURFACE-COLOR-MAP command to set the background index.

Two other commands also control the background color: BACKGROUND-GRAY-LEVEL and SET-BACKGROUND-COLOR. These commands do not set a color index, you specify them in the current color system parameters.

Background Indices

You can specify the background index for text in the graph-ics area and the color of line gaps in dotted and dashed lines with the SET-BACKGROUND-INDICES command.

Hint

Im Dokument 4110 SERIES HOST PROGRAMMERS (Seite 83-88)