	SUBROUTINE GSCOLR(ICOLOR,IERR)
	COMMON /GCDCHR/ DEVID, XLENCM, YLENCM, XRES, YRES,
	1   NDCLRS, IDVBTS, NFLINE, XCLIPD, YCLIPD
C
C	SELECT COLOR "ICOLOR" ON CURRENT DEVICE
C
	LOGICAL*1 LNOBKG
	IERR = 0
C
C	LNOBKG SET TO TRUE IF NO BACKGROUND COLOR EXISTS ON THIS DEVICE
C
	LNOBKG = IAND(IDVBTS,4) .EQ. 0
C
C	FIRST, ERROR IF BACKGROUND COLOR REQUESTED AND DEVICE DOES NOT
C	SUPPORT BACKGROUND COLOR WRITE.
C
	IF (ICOLOR .EQ. 0 .AND. LNOBKG) GO TO 900
C
C	SECOND, ERROR IF COLOR REQUESTED IS LARGER THAN THE NUMBER OF
C	FOREGROUND COLORS AVAILABLE ON THIS DEVICE
C
	IF (ICOLOR .GT. NDCLRS) GO TO 900
C
C	IF ONLY 1 FOREGROUND COLOR AND NO BACKGROUND COLOR, THEN
C	DRIVER WILL NOT SUPPORT SET COLOR, AND OF COURSE, THE
C	COLOR MUST BE COLOR 1 TO HAVE GOTTEN THIS FAR, SO JUST RETURN
C
	IF (NDCLRS .EQ. 1 .AND. LNOBKG) RETURN
C
C	ALL IS OK, SO SET THE REQUESTED COLOR
C
100	CALL GSDRVR(8,FLOAT(ICOLOR),DUMMY)
	RETURN
900	IERR = -1
	RETURN
	END
