	PROGRAM GPE12
!	Test device color capabilities
	INCLUDE 'SYS$LIBRARY:GKSDEFS.BND'
	INTEGER WKTYPE,CFLAG,MASK
	CHARACTER*30 HEAD3
	DATA MASK/'FF'X/
	
	CALL ORIENT('PORTRAIT')
	CALL GSTART
	CALL GQACWK(1,IERR,NACTV,IWK)
	CALL GQWKC(IWK,IERR,ICON,WKTYPE)
	CALL GQCF(WKTYPE,IERR,NCOLOR,CFLAG,NINDEX)
	CALL PAGE(8.5,11.0)
	CALL AREA2D(6.5,7.0)
	CALL HEIGHT(0.20)
	CALL HEADIN('GPLOT Example 12$',100,1.5,3)
	CALL HEADIN('Named Device Colors$',100,1.5,3)
	WKTYPE = WKTYPE .AND. MASK
	WRITE(HEAD3,100) WKTYPE
100	FORMAT(' Workstation Type ',I3,'$')
	CALL HEADIN(HEAD3,100,1.5,3)
C	CALL HEADIN(%REF(HEAD3),100,1.5,3)

	CALL HEIGHT(0.25)
	CALL GSFAIS(GSOLID)    		! Set Fill Area Style to Solid

	CALL NEWCLR('FOREGROUND')
	CALL BLREC (0.0,0.5,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(0.5,0.5,'FOREGROUND')
	CALL GQFAIS(IERR,IFAIS)		! Find current Fill Area Style (FAIS)
	CALL BLREC(0.5,0.9,2.5,0.5,2.0)	! Fill area with foreground color
	CALL NEWCLR('BACKGROUND')	! Set color to Background
	CALL CHRMSG(0.5,1.0,'BACKGROUND')
	CALL GSFAIS(IFAIS)		! Reset FAIS

	IF(CFLAG .EQ. GMONOC) GOTO 30

	CALL NEWCLR('GREEN')
	CALL BLREC (0.0,1.5,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(0.5,1.5,'GREEN')

	CALL NEWCLR('RED')
	CALL BLREC (0.0,2.0,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(0.5,2.0,'RED')

	IF(NCOLOR .LE. 4) GOTO 30

	CALL NEWCLR('BLUE')
	CALL BLREC (0.0,2.5,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(0.5,2.5,'BLUE')

	CALL NEWCLR('YELLOW')
	CALL BLREC (0.0,3.0,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(0.5,3.0,'YELLOW')

	CALL NEWCLR('CYAN')
	CALL BLREC (0.0,3.5,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(0.5,3.5,'CYAN')

	CALL NEWCLR('MAGENTA')
	CALL BLREC (0.0,4.0,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(0.5,4.0,'MAGENTA')

	IF(NCOLOR .LE. 8) GOTO 30

	CALL NEWCLR('WHITE')
	CALL BLREC (0.0,4.5,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(0.5,4.5,'WHITE')

	CALL NEWCLR('BLACK')
	CALL BLREC (0.0,5.0,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(0.5,5.0,'BLACK')
	IF(NCOLOR .LE. 8) GOTO 30

	CALL NEWCLR('YHGR')
	CALL BLREC (0.0,5.5,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(0.5,5.5,'YHGR')

	CALL NEWCLR('YEGR')
	CALL BLREC (0.0,6.0,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(0.5,6.0,'YEGR')

	CALL NEWCLR('PURPLE')
	CALL BLREC (3.5,0.5,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(4.0,0.5,'PURPLE')

	CALL NEWCLR('PEACH')
	CALL BLREC (3.5,1.0,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(4.0,1.0,'PEACH')

	CALL NEWCLR('SKY')
	CALL BLREC (3.5,1.5,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(4.0,1.5,'SKY')

	CALL NEWCLR('ORANGE')
	CALL BLREC (3.5,2.0,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(4.0,2.0,'ORANGE')

	CALL NEWCLR('BROWN')
	CALL BLREC (3.5,2.5,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(4.0,2.5,'BROWN')

	CALL NEWCLR('PINK')
	CALL BLREC (3.5,3.0,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(4.0,3.0,'PINK')

	CALL NEWCLR('OLIVE')
	CALL BLREC (3.5,3.5,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(4.0,3.5,'OLIVE')

	CALL NEWCLR('BEIGE')
	CALL BLREC (3.5,4.0,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(4.0,4.0,'BEIGE')

	CALL NEWCLR('GRAY')
	CALL BLREC (3.5,4.5,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(4.0,4.5,'GRAY or (GREY)')

	CALL NEWCLR('TURQUOISE')
	CALL BLREC (3.5,5.0,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(4.0,5.0,'TURQUOISE')

	CALL NEWCLR('TANGERINE')
	CALL BLREC (3.5,5.5,0.4,0.5,2.0) ! Draw Box in current color
	CALL CHRMSG(4.0,5.5,'TANGERINE')
	
30	CALL NEWCLR('FORE')
	CALL ENDPL(0)
	CALL GSTOP
	CALL EXIT
	END
