全部で4色?

 投稿者:しばっち  投稿日:2013年12月15日(日)19時00分42秒
  LET R1=255
LET G1=0
LET B1=255
!'
LET R2=0
LET G2=255
LET B2=150
!'
LET R3=255
LET G3=150
LET B3=0
CALL GINIT(700,600)
CALL DISPLAY(R1,G1,B1,R2,G2,B2,R3,G3,B3,8)
PAUSE
CLEAR
CALL DISPLAY(R1,G1,B1,R2,G2,B2,R3,G3,B3,80)
END

EXTERNAL  SUB DISPLAY(R1,G1,B1,R2,G2,B2,R3,G3,B3,SIZE)
CALL BOXFULL(  0,0, 99,599,SIZE,R1,G1,B1,R2,G2,B2)
CALL BOXFULL(100,0,199,599,SIZE,R1,G1,B1,R3,G3,B3)
CALL BOXFULL(200,0,299,599,SIZE,R2,G2,B2,R3,G3,B3)
CALL BOXFULL(300,0,399,599,SIZE,R1,G1,B1,R3,G3,B3)
CALL BOXFULL(400,0,499,599,SIZE,R1,G1,B1,R2,G2,B2)
CALL BOXFULL(500,0,599,599,SIZE,R1,G1,B1,R3,G3,B3)
CALL BOXFULL(600,0,699,599,SIZE,R2,G2,B2,R3,G3,B3)
END SUB

EXTERNAL SUB GINIT(XSIZE,YSIZE)
SET BITMAP SIZE XSIZE,YSIZE
SET COLOR MODE "NATIVE"
CLEAR
SET POINT STYLE 1
SET WINDOW 0,XSIZE-1,YSIZE-1,0
END SUB

EXTERNAL SUB BOXFULL(X0,Y0,X1,Y1,SIZE,R1,G1,B1,R2,G2,B2)
FOR Y=Y0 TO Y1
   LET K=INT(Y/SIZE)
   FOR X=X0 TO X1
      IF MOD(K,2)=0 THEN
         SET COLOR COLORINDEX(R1/255,G1/255,B1/255)
      ELSE
         SET COLOR COLORINDEX(R2/255,G2/255,B2/255)
      END IF
      PLOT POINTS:X,Y
   NEXT X
NEXT Y
END SUB
 

戻る