Design: 04.03.02.02/P07
This is an abstract, language-independent design. Grim
details may be found in the
corresponding source code.
You may return to the
documentation
for the module containing this program design, or to the
entire hierarchical table of
topics covered by the PVT.
PROGRAM 7: Hue recognition for colour models
CHARACTERISTICS: ynny
OPERATOR SCRIPT:
APPEARANCE OF BASIC COLORS IN RGB: The screen should display a
column of several colored rectangles, representing some of the
vertices of the RGB cube, and also possibly the center point.
Indicate the order of the rectangles' colors (starting from the
top) to confirm their recognizability. Use the color key in the
prompt (1=black, 2=blue, etc.) to indicate the color order.
APPEARANCE OF INTERMEDIATE COLORS IN RGB: The screen should
display four colored rectangles, representing a normal hue and
three variants (light, grayish, dark) of that hue. Indicate the
order of colors to confirm their recognizability.
APPEARANCE OF BASIC COLORS IN HSV: Same as for RGB, above.
APPEARANCE OF INTERMEDIATE COLORS IN HSV: Same as for RGB, above.
APPEARANCE OF BASIC COLORS IN HLS: Same as for RGB, above.
APPEARANCE OF INTERMEDIATE COLORS IN HLS: Same as for RGB, above.
APPEARANCE OF BASIC COLORS IN CIE: Same as for RGB, above.
APPEARANCE OF COMPOUND HUES IN CIE: Same as for APPEARANCE OF
BASIC COLORS IN CIE, above.
DESIGN:
<inquire color facilities> to determine
sizpal = number of colours available (size of palette)
colavl = COLOR/MONOCHROME
if (colavl not= COLOR) then
informational message: multi-hue color not available; skipping
all hue tests.
goto end_hue
endif
if (sizpal > 0 and sizpal < 27) then
informational message: number of available colors too low for
reliable testing; skipping all hue tests.
goto end_hue
endif
<inquire workstation state table lengths> to determine
mcoli = maximum number of color indices
maxfg = maximum available #foreground colors, besides #1
= mcoli-1
if (maxfg < 4) then
informational message: number of available color entries too
low for reliable testing; skipping all hue tests.
goto end_hue
endif
if (solid interior style available) then
throughout, use solid fill area for color patches
else
use dense polyline cross-hatch for color patches
endif
<inquire color model facilities> to determine
lscmod = list of color models
set background to dark gray
*** *** *** *** RGB *** *** *** ***
if (lscmod does not contain RGB) then
informational message: RGB color model not available; skipping
RGB tests.
goto end_rgb
endif
set color model = RGB
set as many foreground colors as possible in the color table,
starting with entry #2
hues:
red 1, 0, 0
yellow 1, 1, 0
green 0, 1, 0
cyan 0, 1, 1
blue 0, 0, 1
magenta 1, 0, 1
neutrals:
white 1, 1, 1
gray .5,.5,.5
black 0, 0, 0
numset = number actually set and realized in color table
if (numset < 4) then
informational message: Realized basic colors not accurate
enough for testing RGB color model.
goto end_rgb
endif
TEST: #SR 1 5 16 17 21 22 32 33
"The basic hues and neutral colors should appear as
described within the RGB color model."
In random order, display color patches for color entries #2 - #numset+1
OPQA/APPEARANCE OF BASIC COLORS IN RGB: Enter a list of color
identifiers which corresponds to the order (from top to bottom)
of displayed rectangles.
pass/fail depending on
(operator response matches actual order of colors as displayed)
if (sizpal > 0 and sizpal < 64) then
informational message: number of available colors too low for
reliable testing of intermediate RGB hues.
goto end_rgb
endif
didtst = have any shading tests been performed = false
Formulas for intermediate hues:
light hue = 0.3*hue + 0.7*white
grayish hue = 0.3*hue + 0.7*gray
dark hue = 0.4*hue + 0.6*black
for each primary hue = red,yellow,green,cyan,blue,magenta
liscol = primary,light,dark,gray shades of hue, in random order
try to set colors 2 thru 5 to those in liscol
if (could not set) then
goto next hue
endif
didtst = true
display colored rectangles from top to bottom
OPQA/APPEARANCE OF INTERMEDIATE COLORS IN RGB: Enter a list of
color identifiers which corresponds to the order (from top to
bottom) of displayed rectangles. The identifiers are: 1-normal,
2-light, 3-grayish, and 4-dark shade of + (name of hue)
if (operator response incorrect) then
goto end_rgb_loop
endif
end_rgb_hue:
next hue
end_rgb_loop:
if (didtst) then
TEST: #SR 1 5 16 17 21 22 32 33
"The intermediate hues should appear as described within
the RGB color model."
pass/fail depending on (all operator lists were correct)
else
informational message: realized intermediate colors not
accurate enough for testing RGB color model.
endif
end_rgb:
*** *** *** *** HSV *** *** *** ***
if (lscmod does not contain HSV) then
informational message: HSV color model not available; skipping
HSV tests.
goto end_hsv
endif
set color model = HSV
set as many foreground colors as possible in the color table,
starting with entry #2
hues:
red 0, 1,1
yellow .1667, 1,1
green .3333, 1,1
cyan .5, 1,1
blue .6667, 1,1
magenta .8333, 1,1
neutrals:
white -1, 0,1
gray -1, 0,.5
black -1,-1,0
numset = number actually set and realized in color table
if (numset < 4) then
informational message: Realized basic colors not accurate
enough for testing HSV color model.
goto end_hsv
endif
TEST: #SR 1 5 16 17 21 24 32 33
"The basic hues and neutral colors should appear as
described within the HSV color model."
In random order, display color patches for color entries #2 - #numset+1
OPQA/APPEARANCE OF BASIC COLORS IN HSV: Enter a list of color
identifiers which corresponds to the order (from top to bottom)
of displayed rectangles.
pass/fail depending on
(operator response matches actual order of colors as displayed)
if (sizpal > 0 and sizpal < 64) then
informational message: number of available colors too low for
reliable testing of intermediate HSV hues.
goto end_hsv
endif
didtst = have any shading tests been performed = false
Formulas for intermediate hues:
grayish hue = change saturation from 1 to 0.5 and
change value from 1 to 0.7
dark hue = change value from 1 to 0.7
light hue = change saturation from 1 to 0.5
for each primary hue = red,yellow,green,cyan,blue,magenta
liscol = primary,light,dark,gray shades of hue, in random order
try to set colors 2 thru 5 to those in liscol
if (could not set) then
goto next hue
endif
didtst = true
display colored rectangles from top to bottom
OPQA/APPEARANCE OF INTERMEDIATE COLORS IN HSV: Enter a list of
color identifiers which corresponds to the order (from top to
bottom) of displayed rectangles. The identifiers are: 1-normal,
2-light, 3-grayish, and 4-dark shade of + (name of hue)
if (operator response incorrect) then
goto end_hsv_loop
endif
end_hsv_hue:
next hue
end_hsv_loop:
if (didtst) then
TEST: #SR 1 5 16 17 21 24 32 33
"The intermediate hues should appear as described within
the HSV color model."
pass/fail depending on (all operator lists were correct)
else
informational message: realized intermediate colors not
accurate enough for testing HSV color model.
endif
end_hsv:
*** *** *** *** HLS *** *** *** ***
if (lscmod does not contain HLS) then
informational message: HLS color model not available; skipping
HLS tests.
goto end_hls
endif
set color model = HLS
set as many foreground colors as possible in the color table,
starting with entry #2
hues:
red 0,.5,1
yellow .1667,.5,1
green .3333,.5,1
cyan .5,.5,1
blue .6667,.5,1
magenta .8333,.5,1
neutrals:
white -1,1,-1
gray -1,.5,0
black -1,0,-1
numset = number actually set and realized in color table
if (numset < 4) then
informational message: Realized basic colors not accurate
enough for testing HLS color model.
goto end_hls
endif
TEST: #SR 1 5 16 17 21 25 32 33
"The basic hues and neutral colors should appear as
described within the HLS color model."
In random order, display color patches for color entries #2 - #numset+1
OPQA/APPEARANCE OF BASIC COLORS IN HLS: Enter a list of color
identifiers which corresponds to the order (from top to bottom)
of displayed rectangles.
pass/fail depending on
(operator response matches actual order of colors as displayed)
if (sizpal > 0 and sizpal < 64) then
informational message: number of available colors too low for
reliable testing of intermediate HLS hues.
goto end_hls
endif
didtst = have any shading tests been performed = false
Formulas for intermediate hues:
grayish hue = change saturation from 1 to .5
dark hue = change lightness from .5 to .3
light hue = change lightness from .5 to .8
for each primary hue = red,yellow,green,cyan,blue,magenta
liscol = primary,light,dark,gray shades of hue, in random order
try to set colors 2 thru 5 to those in liscol
if (could not set) then
goto next hue
endif
didtst = true
display colored rectangles from top to bottom
OPQA/APPEARANCE OF INTERMEDIATE COLORS IN HLS: Enter a list of
color identifiers which corresponds to the order (from top to
bottom) of displayed rectangles. The identifiers are: 1-normal,
2-light, 3-grayish, and 4-dark shade of + (name of hue)
if (operator response incorrect) then
goto end_hls_loop
endif
end_hls_hue:
next hue
end_hls_loop:
if (didtst) then
TEST: #SR 1 5 16 17 21 25 32 33
"The intermediate hues should appear as described within
the HLS color model."
pass/fail depending on (all operator lists were correct)
else
informational message: realized intermediate colors not
accurate enough for testing HLS color model.
endif
end_hls:
*** *** *** *** CIE *** *** *** ***
if (lscmod does not contain CIE) then
informational message: CIE color model not available; skipping
CIE tests.
goto end_cie
endif
set color model = CIE
set as many foreground colors as possible in the color table,
starting with entry #2
hues:
purple 0.27300, 0.21274, 1
blue 0.12789, 0.24391, 1
green 0.03119, 0.53718, 1
yellow 0.24355, 0.55067, 1
orange 0.31424, 0.54033, 1
red 0.53377, 0.48834, 1
pink 0.34292, 0.48012, 1
neutrals:
white 0.19499, 0.46412, 1
gray 0.19499, 0.46412, 0.5
black -1, -1, 0
basic colors =
(red, orange, yellow, green, blue, purple, pink, white, gray,
black)
numset = number actually set and realized in color table
if (numset < 4) then
informational message: Realized basic colors not accurate
enough for testing CIE color model.
goto end_cie
endif
TEST: #SR 1 5 16 17 21 23 32 33
"The basic hues and neutral colors should appear as
described within the CIE color model."
In random order, display color patches for color entries #2 - #numset+1
OPQA/APPEARANCE OF BASIC COLORS IN CIE: Enter a list of color
identifiers which corresponds to the order (from top to bottom)
of displayed rectangles.
pass/fail depending on
(operator response matches actual order of displayed colors)
if (sizpal > 0 and sizpal < 64) then
informational message: number of available colors too low for
reliable testing of intermediate CIE hues.
goto end_cie
endif
didtst = have any shading tests been performed = false
group1, group2 chosen to avoid adjacent colors within a group:
group1 of compound hues =
purplish blue 0.19783, 0.11434, 1
greenish blue 0.08062, 0.36172, 1
yellowish green 0.10592, 0.56614, 1
greenish yellow 0.21071, 0.55192, 1
orange yellow 0.27763, 0.54550, 1
purplish red 0.49906, 0.39395, 1
group2 of compound hues =
bluish green 0.05087, 0.45206, 1
yellow green 0.18037, 0.55056, 1
reddish orange 0.38490, 0.52474, 1
reddish purple 0.42005, 0.28769, 1
yellowish pink 0.31657, 0.50889, 1
purplish pink 0.31096, 0.41980, 1
for both group1 and group2:
try to set color table to colors of this group, starting with
entry #2
numset = number actually set and realized in color table
if (numset < 4) then
goto next group
endif
didtst = true
In random order, display color patches for color entries #2 -
#numset+1
OPQA/APPEARANCE OF COMPOUND HUES IN CIE: Enter a list of color
identifiers which corresponds to the order (from top to bottom)
of displayed rectangles.
if (operator response incorrect) then
goto end_compound
endif
next group
end_compound:
if (didtst) then
TEST: #SR 1 5 16 17 21 23 32 33
"The compound hues should appear as described within the
CIE color model."
pass/fail depending on (operator responses were correct)
else
informational message: realized compound hues not accurate
enough for testing.
endif
end_cie:
end_hue:
END PROGRAM 7