home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / pascal / shdk_1.zip / SHCLRDEF.PAS < prev    next >
Pascal/Delphi Source File  |  1992-03-23  |  21KB  |  530 lines

  1. {$D-,L-,R-,S-}
  2. unit ShClrdef;
  3. {
  4.                                 ShClrDef
  5.  
  6.                           A Screen Color Unit
  7.  
  8.                                    by
  9.  
  10.                               Bill Madison
  11.  
  12.                    W. G. Madison and Associates, Ltd.
  13.                           13819 Shavano Downs
  14.                             P.O. Box 780956
  15.                        San Antonio, TX 78278-0956
  16.                              (512)492-2777
  17.                              CIS 73240,342
  18.  
  19.                   Copyright 1991 Madison & Associates
  20.                           All Rights Reserved
  21.  
  22.         This file may  be used and distributed  only in accord-
  23.         ance with the provisions described on the title page of
  24.                   the accompanying documentation file
  25.                               SKYHAWK.DOC
  26. }
  27.  
  28. Interface
  29.  
  30. uses
  31.   TpWindow,
  32.   TpCrt;
  33.  
  34. const
  35.  
  36.         {Color constants:
  37.          Black     = 0; Blue   = 1; Green   = 2; Cyan   = 3; Red   = 4;
  38.          Magenta   = 5; Brown  = 6; LtGray  = 7;
  39.          DkGray    = 8; LtBlue = 9; LtGreen = A; LtCyan = B; LtRed = C;
  40.          LtMagenta = D; Yellow = E; White   = F
  41.          }
  42.  
  43.         {Screen color constants}
  44.         {Black text}                       {Blue text}
  45.         BlackOnBlack       = $00;          BlueOnBlack        = $01;
  46.         BlackOnBlue        = $10;          BlueOnBlue         = $11;
  47.         BlackOnGreen       = $20;          BlueOnGreen        = $21;
  48.         BlackOnCyan        = $30;          BlueOnCyan         = $31;
  49.         BlackOnRed         = $40;          BlueOnRed          = $41;
  50.         BlackOnMagenta     = $50;          BlueOnMagenta      = $51;
  51.         BlackOnBrown       = $60;          BlueOnBrown        = $61;
  52.         BlackOnLtGray      = $70;          BlueOnLtGray       = $71;
  53.  
  54.         {Green text}                       {Cyan text}
  55.         GreenOnBlack       = $02;          CyanOnBlack        = $03;
  56.         GreenOnBlue        = $12;          CyanOnBlue         = $13;
  57.         GreenOnGreen       = $22;          CyanOnGreen        = $23;
  58.         GreenOnCyan        = $32;          CyanOnCyan         = $33;
  59.         GreenOnRed         = $42;          CyanOnRed          = $43;
  60.         GreenOnMagenta     = $52;          CyanOnMagenta      = $53;
  61.         GreenOnBrown       = $62;          CyanOnBrown        = $63;
  62.         GreenOnLtGray      = $72;          CyanOnLtGray       = $73;
  63.  
  64.         {Red text}                         {Magenta text}
  65.         RedOnBlack         = $04;          MagentaOnBlack     = $05;
  66.         RedOnBlue          = $14;          MagentaOnBlue      = $15;
  67.         RedOnGreen         = $24;          MagentaOnGreen     = $25;
  68.         RedOnCyan          = $34;          MagentaOnCyan      = $35;
  69.         RedOnRed           = $44;          MagentaOnRed       = $45;
  70.         RedOnMagenta       = $54;          MagentaOnMagenta   = $55;
  71.         RedOnBrown         = $64;          MagentaOnBrown     = $65;
  72.         RedOnLtGray        = $74;          MagentaOnLtGray    = $75;
  73.  
  74.         {Brown text}                       {Light Gray text}
  75.         BrownOnBlack       = $06;          LtGrayOnBlack      = $07;
  76.         BrownOnBlue        = $16;          LtGrayOnBlue       = $17;
  77.         BrownOnGreen       = $26;          LtGrayOnGreen      = $27;
  78.         BrownOnCyan        = $36;          LtGrayOnCyan       = $37;
  79.         BrownOnRed         = $46;          LtGrayOnRed        = $47;
  80.         BrownOnMagenta     = $56;          LtGrayOnMagenta    = $57;
  81.         BrownOnBrown       = $66;          LtGrayOnBrown      = $67;
  82.         BrownOnLtGray      = $76;          LtGrayOnLtGray     = $77;
  83.  
  84.         {Dark Gray text}                   {Light Blue text}
  85.         DkGrayOnBlack      = $08;          LtBlueOnBlack      = $09;
  86.         DkGrayOnBlue       = $18;          LtBlueOnBlue       = $19;
  87.         DkGrayOnGreen      = $28;          LtBlueOnGreen      = $29;
  88.         DkGrayOnCyan       = $38;          LtBlueOnCyan       = $39;
  89.         DkGrayOnRed        = $48;          LtBlueOnRed        = $49;
  90.         DkGrayOnMagenta    = $58;          LtBlueOnMagenta    = $59;
  91.         DkGrayOnBrown      = $68;          LtBlueOnBrown      = $69;
  92.         DkGrayOnLtGray     = $78;          LtBlueOnLtGray     = $79;
  93.  
  94.         {Light Green Text}                 {Light Cyan text}
  95.         LtGreenOnBlack     = $0A;          LtCyanOnBlack      = $0B;
  96.         LtGreenOnBlue      = $1A;          LtCyanOnBlue       = $1B;
  97.         LtGreenOnGreen     = $2A;          LtCyanOnGreen      = $2B;
  98.         LtGreenOnCyan      = $3A;          LtCyanOnCyan       = $3B;
  99.         LtGreenOnRed       = $4A;          LtCyanOnRed        = $4B;
  100.         LtGreenOnMagenta   = $5A;          LtCyanOnMagenta    = $5B;
  101.         LtGreenOnBrown     = $6A;          LtCyanOnBrown      = $6B;
  102.         LtGreenOnLtGray    = $7A;          LtCyanOnLtGray     = $7B;
  103.  
  104.         {Light Red text}                   {Light Magenta text}
  105.         LtRedOnBlack       = $0C;          LtMagentaOnBlack   = $0D;
  106.         LtRedOnBlue        = $1C;          LtMagentaOnBlue    = $1D;
  107.         LtRedOnGreen       = $2C;          LtMagentaOnGreen   = $2D;
  108.         LtRedOnCyan        = $3C;          LtMagentaOnCyan    = $3D;
  109.         LtRedOnRed         = $4C;          LtMagentaOnRed     = $4D;
  110.         LtRedOnMagenta     = $5C;          LtMagentaOnMagenta = $5D;
  111.         LtRedOnBrown       = $6C;          LtMagentaOnBrown   = $6D;
  112.         LtRedOnLtGray      = $7C;          LtMagentaOnLtGray  = $7D;
  113.  
  114.         {Yellow text}                      {White text}
  115.         YellowOnBlack      = $0E;          WhiteOnBlack       = $0F;
  116.         YellowOnBlue       = $1E;          WhiteOnBlue        = $1F;
  117.         YellowOnGreen      = $2E;          WhiteOnGreen       = $2F;
  118.         YellowOnCyan       = $3E;          WhiteOnCyan        = $3F;
  119.         YellowOnRed        = $4E;          WhiteOnRed         = $4F;
  120.         YellowOnMagenta    = $5E;          WhiteOnMagenta     = $5F;
  121.         YellowOnBrown      = $6E;          WhiteOnBrown       = $6F;
  122.         YellowOnLtGray     = $7E;          WhiteOnLtGray      = $7F;
  123.  
  124. type
  125.   Orientation = (Vertical, Horizontal);
  126.  
  127. function SelectColors(Row, Col, BegAttr : byte;
  128.                       CpFrameChars      : FrameArray;
  129.                       Orient            : Orientation;
  130.                       ErasePanelOnExit,
  131.                       EraseCursorOnExit,
  132.                       WrapCursor        : boolean;
  133.                       Header  : string) : byte;
  134. {
  135.     *   Displays a 16x8 panel of text colors with the window coordinates
  136.         of the upper left corner at coordinates X=Col, Y=Row.
  137.     *   The attribute at which the cursor will be initially placed is
  138.         at BegAttr.
  139.     *   The color panel will be framed using the characters specified
  140.         in CpFrameChars.
  141.     *   Allows the user to navigate the panel with the arrow keys and
  142.         select the desired color combination by pressing <CR>. The user
  143.         can also press <INS>, which will return a function value of $FF,
  144.         and by convention, should be taken to indicate that the currently
  145.         selected attribute value is to be unchanged. Additionally, the
  146.         user can press <ESC>, returning a function value of $FE, which by
  147.         convention should be taken to indicate that the current color
  148.         selection run is completed. Finally, a return of $FD indicates
  149.         that the user has pressed the <F1> key either alone or in com-
  150.         bination with one of the shift-type keys (<L-SHIFT>, <R-SHIFT>,
  151.         <CTRL>, or <ALT>), and by convention indicates that the user is
  152.         requesting help.
  153.     *   ErasePanelOnExit determines whether the panel is erased or preserved
  154.         on the screen when SelectColors returns to the caller.
  155.         The panel is always disposed, and its heap space reclaimed.
  156.     *   EraseCursorOnExit is only effective if ErasePanelOnExit is false.
  157.         If the panel is to be preserved between calls to SelectColors,
  158.         EraseCursor determines whether the or not the cursor will continue
  159.         to be displayed along with the panel.
  160.     *   WrapCursor determines whether the cursor will wrap both horizontally
  161.         and vertically. True allows the cursor to wrap; False inhibits
  162.         further cursor movement when a window edge is reached.
  163.     *   Header is the header line which will be displayed on the panel. It
  164.         can be supplied as an empty string (''), in which case no header
  165.         will be displayed.
  166.     *   The function returns a normal text attribute byte, but with the
  167.         following exceptions:
  168.  
  169.     Return  Explanation
  170.     ------  -----------
  171.     $FF     <INS> was pressed by the user. Leave the current value
  172.             unchanged.
  173.     $FE     <ESC> was pressed by the user. Accept all current values
  174.             and consider the run completed.
  175.     $FD     <F1> was pressed by the user. Provide a HELP screen or
  176.             message.
  177.     $F0     Error in MakeWindow
  178.     $F1     Error in DisplayWindow
  179.  
  180. }
  181.  
  182. function ColorName(Attr  : byte) : string;
  183. {   Given a text attribute byte, ColorName returns the attribute color
  184.     name as defined above; e.g., ColorName($1E) will return 'YellowOnBlue'.
  185.     If a byte value is passed which does not correspond to a valid text
  186.     attribute, an empty string is returned.
  187. }
  188.  
  189. Implementation
  190.  
  191. function SelectColors(Row, Col, BegAttr : byte;
  192.                       CpFrameChars      :FrameArray;
  193.                       Orient            : Orientation;
  194.                       ErasePanelOnExit,
  195.                       EraseCursorOnExit,
  196.                       WrapCursor        : boolean;
  197.                       Header  : string) : byte;
  198.   type
  199.     DirectionType = (Up, Down, Left, Right);
  200.   var
  201.     NCols, NRows,
  202.     ColInc, RowInc: byte;
  203.     T1, T2        : integer;
  204.     C1            : char;
  205.     W1            : word;
  206.     WindowBuf     : pointer;
  207.     ColorPanel    : WindowPtr;
  208.     SavFrameChars : FrameArray;
  209.     EraseP        : boolean;
  210.   procedure MoveCursorBlock(Direction : DirectionType);
  211.     begin
  212.       FastWriteWindow(' X ', WhereY, WhereX, ReadAttrAtCursor);
  213.       case WrapCursor of
  214.         true  :
  215.           case Direction of
  216.             Down  : GoToXY(WhereX, (WhereY mod NRows) + 1);
  217.             Up    : GoToXY(WhereX, NRows - ((RowInc - WhereY) mod NRows));
  218.             Left  : GoToXY((WhereX-3 + (3*NCols)) mod (3*NCols), WhereY);
  219.             Right : GoToXY((WhereX+3 + (3*NCols)) mod (3*NCols), WhereY);
  220.             end; {case Direction}
  221.         false :
  222.           case Direction of
  223.             Down  : GoToXY(WhereX, WhereY+1);
  224.             Up    : GoToXY(WhereX, WhereY-1);
  225.             Left  : GoToXY(WhereX-3, WhereY);
  226.             Right : GoToXY(WhereX+3, WhereY);
  227.             end; {case Direction}
  228.         end; {case WrapCursor}
  229.       FastWriteWindow('[X]', WhereY, WhereX, ReadAttrAtCursor);
  230.       end; {MoveCursorBlock}
  231.   begin {SelectColors}
  232.     {Calculate window dimensions based on orientation}
  233.     case Orient of
  234.       Vertical    : begin
  235.         NCols := 8;
  236.         NRows := 16;
  237.         end;
  238.       Horizontal  : begin
  239.         NCols := 16;
  240.         NRows := 8;
  241.         end;
  242.       end; {case Orient}
  243.     ColInc := 3 * NCols + 1;
  244.     RowInc := NRows + 1;
  245.  
  246.     {Check position parameters}
  247.     if Row = 0 then
  248.       Row := (ScreenHeight - RowInc) shr 1;
  249.     if Col = 0 then
  250.       Col := (ScreenWidth - ColInc) shr 1;
  251.     if (Row+RowInc > ScreenHeight) then
  252.       Row := ScreenHeight - RowInc;
  253.     if (Col+ColInc > ScreenWidth) then
  254.       Col := ScreenWidth - ColInc;
  255.  
  256.     {General housekeeping}
  257.     HiddenCursor;
  258.     SavFrameChars := FrameChars;
  259.  
  260.     {Set frame as specified in call}
  261.     FrameChars := CpFrameChars;
  262.  
  263.     {Build the color panel}
  264.     if not MakeWindow(ColorPanel, Col, Row, Col+ColInc, Row+RowInc,
  265.                   true, false, false,
  266.                   $07, $07, $07, Header) then begin
  267.       SelectColors := $F0;
  268.       NormalCursor;
  269.       FrameChars := SavFrameChars;
  270.       exit;
  271.       end;
  272.     if not DisplayWindow(ColorPanel) then begin
  273.       SelectColors := $F1;
  274.       NormalCursor;
  275.       FrameChars := SavFrameChars;
  276.       exit;
  277.       end;
  278.     for T1 := 0 to NRows-1 do
  279.       for T2 := 0 to NCols-1 do
  280.         case Orient of
  281.           Vertical    : FastWriteWindow
  282.                           (' X ', T1+1, 3*T2+1, ((T2 shl 4) + T1));
  283.           Horizontal  : FastWriteWindow
  284.                           (' X ', T1+1, 3*T2+1, ((T1 shl 4) + T2));
  285.           end; {case Orient}
  286.  
  287.     {Place the cursor as specified in call}
  288.     case Orient of
  289.       Vertical    : GoToXY(3*(BegAttr shr 4)+1, (BegAttr and $0F)+1);
  290.       Horizontal  : GoToXY(3*(BegAttr and $0F)+1, (BegAttr shr 4)+1);
  291.       end;
  292.     FastWriteWindow('[X]',WhereY, WhereX,ReadAttrAtCursor);
  293.  
  294.     {Select the desired color attribute}
  295.     repeat
  296.       W1 := ReadKeyWord;
  297.       case W1 of
  298.         $4800:  begin                       {UpArrow}
  299.                   MoveCursorBlock(Up);
  300.                   end;
  301.         $4B00:  begin                       {LtArrow}
  302.                   MoveCursorBlock(Left);
  303.                   end;
  304.         $4D00:  begin                       {RtArrow}
  305.                   MoveCursorBlock(Right);
  306.                   end;
  307.         $5000:  begin                       {DnArrow}
  308.                   MoveCursorBlock(Down);
  309.                   end;
  310.         end; {case}
  311.       until (W1 = $1C0D {<CR >}) or
  312.             (W1 = $5200 {<INS>}) or
  313.             (W1 = $011B {<ESC>}) or
  314.             (W1 = $3B00 {<F1> }) or
  315.             (W1 = $5400 {<#F1>}) or
  316.             (W1 = $5E00 {<^F1>}) or
  317.             (W1 = $6800 {<@F1>});
  318.  
  319.     {Conditionally save the panel}
  320.     case ErasePanelOnExit of
  321.       false :
  322.         {Conditionally clear the cursor block after selection}
  323.         begin
  324.           case EraseCursorOnExit of
  325.             false : {Do nothing}  ;
  326.             true  :
  327.               begin
  328.                 FastWriteWindow(' X ',WhereY, WhereX, ReadAttrAtCursor);
  329.                 end;
  330.             end; {case EraseCursorOnExit}
  331.           if SaveWindow
  332.             (Col, Row, Col+ColInc, Row+RowInc, true, WindowBuf) then ;
  333.           end; {false}
  334.       true  : {Do nothing}  ;
  335.       end; {case ErasePanelOnExit}
  336.  
  337.     {Set up the return}
  338.     case W1 of
  339.       $5200 {<INS>} : SelectColors := $FF;
  340.       $011B {<ESC>} : SelectColors := $FE;
  341.       $3B00,{<F1> }
  342.       $5400,{<#F1>}
  343.       $5E00,{<^F1>}
  344.       $6800 {<@F1>} : SelectColors := $FD;
  345.       else            begin
  346.                         byte(C1) := ReadAttrAtCursor;
  347.                         SelectColors := byte(C1);
  348.                         end;
  349.       end; {case W1}
  350.  
  351.     {Dispose of the window and conditionally restore the panel}
  352.     DisposeWindow(EraseTopWindow);
  353.     if not ErasePanelOnExit then
  354.       RestoreWindow(Col, Row, Col+ColInc, Row+RowInc, true, WindowBuf);
  355.  
  356.     {Restore the environment and scram}
  357.     NormalCursor;
  358.     FrameChars := SavFrameChars;
  359.    end;
  360.  
  361. function ColorName(Attr  : byte) : string;
  362.   begin
  363.     case Attr of
  364.  
  365.       {Black text}
  366.       $00 : ColorName := 'BlackOnBlack';
  367.       $10 : ColorName := 'BlackOnBlue';
  368.       $20 : ColorName := 'BlackOnGreen';
  369.       $30 : ColorName := 'BlackOnCyan';
  370.       $40 : ColorName := 'BlackOnRed';
  371.       $50 : ColorName := 'BlackOnMagenta';
  372.       $60 : ColorName := 'BlackOnBrown';
  373.       $70 : ColorName := 'BlackOnLtGray';
  374.  
  375.             {Blue text}
  376.       $01 : ColorName := 'BlueOnBlack';
  377.       $11 : ColorName := 'BlueOnBlue';
  378.       $21 : ColorName := 'BlueOnGreen';
  379.       $31 : ColorName := 'BlueOnCyan';
  380.       $41 : ColorName := 'BlueOnRed';
  381.       $51 : ColorName := 'BlueOnMagenta';
  382.       $61 : ColorName := 'BlueOnBrown';
  383.       $71 : ColorName := 'BlueOnLtGray';
  384.  
  385.             {Green text}
  386.       $02 : ColorName := 'GreenOnBlack';
  387.       $12 : ColorName := 'GreenOnBlue';
  388.       $22 : ColorName := 'GreenOnGreen';
  389.       $32 : ColorName := 'GreenOnCyan';
  390.       $42 : ColorName := 'GreenOnRed';
  391.       $52 : ColorName := 'GreenOnMagenta';
  392.       $62 : ColorName := 'GreenOnBrown';
  393.       $72 : ColorName := 'GreenOnLtGray';
  394.  
  395.             {Cyan text}
  396.       $03 : ColorName := 'CyanOnBlack';
  397.       $13 : ColorName := 'CyanOnBlue';
  398.       $23 : ColorName := 'CyanOnGreen';
  399.       $33 : ColorName := 'CyanOnCyan';
  400.       $43 : ColorName := 'CyanOnRed';
  401.       $53 : ColorName := 'CyanOnMagenta';
  402.       $63 : ColorName := 'CyanOnBrown';
  403.       $73 : ColorName := 'CyanOnLtGray';
  404.  
  405.             {Red text}
  406.       $04 : ColorName := 'RedOnBlack';
  407.       $14 : ColorName := 'RedOnBlue';
  408.       $24 : ColorName := 'RedOnGreen';
  409.       $34 : ColorName := 'RedOnCyan';
  410.       $44 : ColorName := 'RedOnRed';
  411.       $54 : ColorName := 'RedOnMagenta';
  412.       $64 : ColorName := 'RedOnBrown';
  413.       $74 : ColorName := 'RedOnLtGray';
  414.  
  415.             {Magenta text}
  416.       $05 : ColorName := 'MagentaOnBlack';
  417.       $15 : ColorName := 'MagentaOnBlue';
  418.       $25 : ColorName := 'MagentaOnGreen';
  419.       $35 : ColorName := 'MagentaOnCyan';
  420.       $45 : ColorName := 'MagentaOnRed';
  421.       $55 : ColorName := 'MagentaOnMagenta';
  422.       $65 : ColorName := 'MagentaOnBrown';
  423.       $75 : ColorName := 'MagentaOnLtGray';
  424.  
  425.             {Brown text}
  426.       $06 : ColorName := 'BrownOnBlack';
  427.       $16 : ColorName := 'BrownOnBlue';
  428.       $26 : ColorName := 'BrownOnGreen';
  429.       $36 : ColorName := 'BrownOnCyan';
  430.       $46 : ColorName := 'BrownOnRed';
  431.       $56 : ColorName := 'BrownOnMagenta';
  432.       $66 : ColorName := 'BrownOnBrown';
  433.       $76 : ColorName := 'BrownOnLtGray';
  434.  
  435.             {Light Gray text}
  436.       $07 : ColorName := 'LtGrayOnBlack';
  437.       $17 : ColorName := 'LtGrayOnBlue';
  438.       $27 : ColorName := 'LtGrayOnGreen';
  439.       $37 : ColorName := 'LtGrayOnCyan';
  440.       $47 : ColorName := 'LtGrayOnRed';
  441.       $57 : ColorName := 'LtGrayOnMagenta';
  442.       $67 : ColorName := 'LtGrayOnBrown';
  443.       $77 : ColorName := 'LtGrayOnLtGray';
  444.  
  445.             {Dark Gray text}
  446.       $08 : ColorName := 'DkGrayOnBlack';
  447.       $18 : ColorName := 'DkGrayOnBlue';
  448.       $28 : ColorName := 'DkGrayOnGreen';
  449.       $38 : ColorName := 'DkGrayOnCyan';
  450.       $48 : ColorName := 'DkGrayOnRed';
  451.       $58 : ColorName := 'DkGrayOnMagenta';
  452.       $68 : ColorName := 'DkGrayOnBrown';
  453.       $78 : ColorName := 'DkGrayOnLtGray';
  454.  
  455.             {Light Blue text}
  456.       $09 : ColorName := 'LtBlueOnBlack';
  457.       $19 : ColorName := 'LtBlueOnBlue';
  458.       $29 : ColorName := 'LtBlueOnGreen';
  459.       $39 : ColorName := 'LtBlueOnCyan';
  460.       $49 : ColorName := 'LtBlueOnRed';
  461.       $59 : ColorName := 'LtBlueOnMagenta';
  462.       $69 : ColorName := 'LtBlueOnBrown';
  463.       $79 : ColorName := 'LtBlueOnLtGray';
  464.  
  465.             {Light Green Text}
  466.       $0A : ColorName := 'LtGreenOnBlack';
  467.       $1A : ColorName := 'LtGreenOnBlue';
  468.       $2A : ColorName := 'LtGreenOnGreen';
  469.       $3A : ColorName := 'LtGreenOnCyan';
  470.       $4A : ColorName := 'LtGreenOnRed';
  471.       $5A : ColorName := 'LtGreenOnMagenta';
  472.       $6A : ColorName := 'LtGreenOnBrown';
  473.       $7A : ColorName := 'LtGreenOnLtGray';
  474.  
  475.             {Light Cyan text}
  476.       $0B : ColorName := 'LtCyanOnBlack';
  477.       $1B : ColorName := 'LtCyanOnBlue';
  478.       $2B : ColorName := 'LtCyanOnGreen';
  479.       $3B : ColorName := 'LtCyanOnCyan';
  480.       $4B : ColorName := 'LtCyanOnRed';
  481.       $5B : ColorName := 'LtCyanOnMagenta';
  482.       $6B : ColorName := 'LtCyanOnBrown';
  483.       $7B : ColorName := 'LtCyanOnLtGray';
  484.  
  485.             {Light Red text}
  486.       $0C : ColorName := 'LtRedOnBlack';
  487.       $1C : ColorName := 'LtRedOnBlue';
  488.       $2C : ColorName := 'LtRedOnGreen';
  489.       $3C : ColorName := 'LtRedOnCyan';
  490.       $4C : ColorName := 'LtRedOnRed';
  491.       $5C : ColorName := 'LtRedOnMagenta';
  492.       $6C : ColorName := 'LtRedOnBrown';
  493.       $7C : ColorName := 'LtRedOnLtGray';
  494.  
  495.             {Light Magenta text}
  496.       $0D : ColorName := 'LtMagentaOnBlack';
  497.       $1D : ColorName := 'LtMagentaOnBlue';
  498.       $2D : ColorName := 'LtMagentaOnGreen';
  499.       $3D : ColorName := 'LtMagentaOnCyan';
  500.       $4D : ColorName := 'LtMagentaOnRed';
  501.       $5D : ColorName := 'LtMagentaOnMagenta';
  502.       $6D : ColorName := 'LtMagentaOnBrown';
  503.       $7D : ColorName := 'LtMagentaOnLtGray';
  504.  
  505.             {Yellow text}
  506.       $0E : ColorName := 'YellowOnBlack';
  507.       $1E : ColorName := 'YellowOnBlue';
  508.       $2E : ColorName := 'YellowOnGreen';
  509.       $3E : ColorName := 'YellowOnCyan';
  510.       $4E : ColorName := 'YellowOnRed';
  511.       $5E : ColorName := 'YellowOnMagenta';
  512.       $6E : ColorName := 'YellowOnBrown';
  513.       $7E : ColorName := 'YellowOnLtGray';
  514.  
  515.             {White text}
  516.       $0F : ColorName := 'WhiteOnBlack';
  517.       $1F : ColorName := 'WhiteOnBlue';
  518.       $2F : ColorName := 'WhiteOnGreen';
  519.       $3F : ColorName := 'WhiteOnCyan';
  520.       $4F : ColorName := 'WhiteOnRed';
  521.       $5F : ColorName := 'WhiteOnMagenta';
  522.       $6F : ColorName := 'WhiteOnBrown';
  523.       $7F : ColorName := 'WhiteOnLtGray';
  524.  
  525.       else  ColorName := '';
  526.       end;
  527.     end;
  528.  
  529. end.
  530.