'=========================================================================== ' Subject: SHOW ALL COMBINATIONS OF COLORS Date: 10-01-96 (08:28) ' Author: Kurt Kuzba Code: QB, QBasic, PDS ' Origin: FidoNet QUIK_BAS Echo Packet: GRAPHICS.ABC '=========================================================================== '> > Actually, that's wrong. You only have 256k (262,000), '> > or 63 times 63 times 63. That's the max for your RGB '> > values. '> Actually, it's 64 times 64 times 64, because there are 64 '> degrees, not 63. '> Count all the numbers from 0 to 63 inclusively. '>.......... ' Correct. 'Total number of colors possible is 64^3, or 262,144 colors. 'For those who wish to count them... '( If anybody actually runs all the way through this program ' without hitting a key, they must be something other than ' human :) '_|_|_| ALLHUES.BAS '_|_|_| A display of all the possible color, 8 at a time. '_|_|_| Hit a key to quit if you like. Produces 262,144 colors. '_|_|_| No warrantee or guarantee is given or implied. '_|_|_| Released PUBLIC DOMAIN by Kurt Kuzba. (10/1/96) RANDOMIZE TIMER SCREEN 12 SCREEN 0 COLOR 7, 0 CLS FOR L% = 2 TO 6 LOCATE L%, 1 FOR C% = 8 TO 15 COLOR C% PRINT STRING$(10, CHR$(219)); NEXT NEXT COLOR 7, 0 Colour% = 0 DIM CRED(64) AS INTEGER DIM CGRN(64) AS INTEGER DIM CBLU(64) AS INTEGER FOR t% = 0 TO 64 CRED(t%) = t% CGRN(t%) = t% CBLU(t%) = t% NEXT '_|_|_| Thanks to Bill White, ( of Miami :), for the '_|_|_| neat shuffle routine. FOR t% = 1 TO 128 SWAP CRED(t% AND 63), CRED(RND * 63) SWAP CGRN(t% AND 63), CGRN(RND * 63) SWAP CBLU(t% AND 63), CBLU(RND * 63) NEXT FOR RED% = 0 TO 63 FOR GRN% = 0 TO 63 FOR BLU% = 0 TO 63 WAIT &H3DA, 8: WAIT &H3DA, 8, 8 hue% = 56 + (BLU% AND 7) OUT &H3C8, hue% OUT &H3C9, CRED(RED%) OUT &H3C9, CGRN(GRN%) OUT &H3C9, CBLU(BLU%) LOCATE 1, 1 Colour& = Colour& + 1 Colr$ = MID$(STR$(Colour&), 2) txt$ = "" p% = LEN(Colr$) FOR t% = 1 TO p% - 1 txt$ = MID$(Colr$, p% - t%, 1) + txt$ IF t% MOD 3 = 0 THEN IF t% < (p% - 1) THEN txt$ = "," + txt$ END IF NEXT PRINT txt$ IF INKEY$ <> "" THEN SCREEN 12: SCREEN 0: END NEXT NEXT NEXT '_|_|_| end ALLHUES.BAS