$INCLUDE: 'C:\FG\INTRFACE.FOR'

      PROGRAM MAIN

      INTEGER*2 COLORS
      PARAMETER (COLORS=256)

      INTEGER*2 BASE
      INTEGER*2 COLOR
      INTEGER*2 MODE
      INTEGER*2 X
      INTEGER*2 FG_GETMODE

      MODE = FG_GETMODE()
      CALL FG_SETMODE(19)

      X = 0

      DO 10 COLOR = 0,COLORS-1
         CALL FG_SETCOLOR(COLOR)
         CALL FG_RECT(X,X,0,199)
         X = X + 1
10    CONTINUE
      CALL FG_WAITKEY

      CALL FG_SETMODE(MODE)
      CALL FG_RESET

      STOP ' '
      END
