OPTION STRICT OPTION DEFINT DEF WR _N,X,Y DIM A,R,G,B,N=ABS(_N) A=(SGN(_N)==-1) R=N DIV 31 DIV 31*8 G=N DIV 31 MOD 31*8 B=N MOD 31*8 GPSET X,Y,RGB(A,R,G,B) END DEF RD(X,Y) DIM A,R,G,B,N RGBREAD GSPOIT(X,Y) OUT A,R,G,B N=R/8*31*31+G/8*31+B/8 IF A THEN N=N*-1 ENDIF RETURN N ENDI never really bothered screwing around with color codes and color conversion before. This method covers the integers from -30751 to 30751. Is there a better way?
Using the graphics pages to store data
Root / Programming Questions / [.]
MZ952Created: