Design: 04.03.02.02/P06

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 6: Colour or monochrome

CHARACTERISTICS: ynny

OPERATOR SCRIPT:

HUE DISCRIMINATION FOR AVAILABLE COLOUR: There should be a
uniformly colored rectangular patch in the middle of the screen.
Pick the color name that best describes the patch.

DESIGN:

set color model = RGB

<inquire colour facilities> to determine
   colavl = colour available? = colour or monochrome

if (colavl = colour) then
   TEST: #SR 4 5 21 22 26 27 33
         "A workstation reported as capable of colour should be
          able to display more than one hue."
elseif (colavl = monochrome) then
   TEST: #SR 4 6 21 22 26 27 33
         "A workstation reported as capable of monochrome should be
          able to display at most one hue."
else
   informational message: Non-standard code for colour available;
      skipping test.
   goto done
endif

Use index #2, unless only 0 and 1 are available:
<inquire workstation state table lengths> to determine
  colsiz = size of color table
if (colsiz > 2) then
   colix = 2
else
   colix = 1
endif

newhue(1:6) = logical table of hues to be seen = all true
for hue = red,yellow,green,cyan,blue,magenta
   set colour representation #colix to hue
   display color patch centered on screen, using colix#:
      solid fill area if available, otherwise
      cross-hatched polylines

   OPQA/HUE DISCRIMINATION FOR AVAILABLE COLOUR: The color of the
      rectangular patch is best described as: 1-red, 2-yellow,
      3-green, 4-cyan, 5-blue, 6-magenta, 7-white, 8-gray, or 9-black?
   opans = operator response

   if (opans = 0) then
      allow operator comment
      fail
      goto done
   elseif (opans < 7) then
      if (newhue(opans) then
         huect = huect+1
         if (huect > 1) goto gothues
         newhue(opans) = false
      endif
   else
      not a distinct hue; do nothing
   endif
next hue

gothues:
if (colavl = colour) then
   pass/fail depending on (huect > 1)
else
   pass/fail depending on (huect <= 1)
endif

done:

END PROGRAM 6