! SET COLOR MIX( color_index) red,green,blue
! red,green,blue should be between 0 and 1
SET COLOR MIX(0) 0,0,0
SET COLOR MIX(1) 0,0,1
SET COLOR MIX(2) 0,1,0
SET COLOR MIX(3) 0,1,1
SET COLOR MIX(4) 1,0,0
SET COLOR MIX(5) 1,0,1
SET COLOR MIX(6) 1,1,0
SET COLOR MIX(7) 1,1,1
CLEAR                  
SET WINDOW 0,8,0,4
FOR x=0 TO 7
   SET AREA COLOR x
   PLOT AREA: x,0; x+1,0; x+1,1; x,1
   SET TEXT COLOR x
   PLOT TEXT ,AT x,1 :str$(x)
NEXT x
!
SET AREA COLOR 1
FOR x=0 TO 8 STEP 0.1
   SELECT CASE x
   CASE 0 TO 2
      LET red=1
      LET green=x/2
      LET blue=0
   CASE 2 TO 4
      LET red=2-x/2
      LET green=1
      LET blue=0
   CASE 4 TO 6
      LET red=0
      LET green=1
      LET blue=x/2-2
   CASE 6 TO 8
      LET red=0
      LET green=4-x/2
      LET blue=1
   END SELECT
   SET COLOR MIX(1) red,green,blue
   PLOT AREA : x,2; x+0.1,2; x+0.1,3; x,3
NEXT x
END
 
