$INCLUDE: 'C:\FG\FASTGRAF.FI'

      PROGRAM MAIN

      INTEGER OLD_MODE
      INTEGER RED, GREEN, BLUE
      INTEGER FG_GETMODE

      CALL FG_INITPM
      OLD_MODE = FG_GETMODE()
      CALL FG_SETMODE(19)

      CALL FG_SETCOLOR(103)
      CALL FG_TEXT('Hello',5)
      CALL FG_WAITFOR(18)

      CALL FG_GETRGB(103,RED,GREEN,BLUE)

10    IF (RED+GREEN+BLUE .GT. 0) THEN
         IF (RED .GT. 0) RED = RED - 1
         IF (GREEN .GT. 0) GREEN = GREEN - 1
         IF (BLUE .GT. 0) BLUE = BLUE - 1
         CALL FG_SETRGB(103,RED,GREEN,BLUE)
         CALL FG_WAITFOR(1)
         GO TO 10
      END IF

      CALL FG_SETMODE(OLD_MODE)
      CALL FG_RESET

      STOP ' '
      END
