stairs Art/Electric
PROGRAMS
general
color methods
col hypercube
fuzzy logic 1
fuzzy logic 2
fuzzy logic 3
macrame
mandelzoom
julia set
ripples
sines
newtons basin
hadamard matrix
 
PROGRAMS 2
L-systems
IF-Systems
 
e-mail
COLOR METHODS
   SINEWAVE EXAMPLES

PROGRAM colormethods     !copyright W.vanDuyn 2004
SET MODE "color"
SET WINDOW 0,1199,0,903   &nsbp; !tuned to 1280x1024 res
CLEAR
SET COLOR "black"
BOX AREA 10,1189,10,893
FLOOD 10,10

!sinewave table approach
LET mi=1
FOR si= 1 TO 226 STEP 25
LET mj=1
FOR sj = 1 TO 226 STEP 25
LET mc=mi+mj*10-10
LET p=17
LET q=3
LET r=2
LET s=19
LET t=11
LET u=7
CALL coltableSinA(mc,p,q,r,s,t,u)
BOX AREA si+100, si+125,sj+625, sj+650
LET mj=mj+1
NEXT sj
LET mi=mi+1
NEXT si
SET COLOR "white"
PLOT TEXT,AT 100,605:"sinewave approach to color #1"

!iterated color approach
LET mi=1
CALL coltableA(ci)
FOR si= 1 TO 226 STEP 25
LET mj=1
FOR sj = 1 TO 226 STEP 25
LET colci=(mj)+10*mi-10
SET COLOR colci
BOX AREA si+400, si+425,sj+300, sj+325
LET mj=mj+1
NEXT sj
LET mi=mi+1
NEXT si
SET COLOR "white"
PLOT TEXT,AT 400,275:"iterated approach to color"

! 216 colors of the 6X6X6 color cube as a chart
FOR ii = 0 TO 255 step 51
FOR jj = 0 TO 255 step 51
FOR kk = 0 TO 255 step 51
LET a=ii/255
LET b=jj/255
LET c=kk/255
SET COLOR MIX (col)a,b,c
CALL plot(kk,ii,jj,col)
NEXT kk
NEXT jj
NEXT ii
SET COLOR "white"
PLOT TEXT,AT 100,75:"all 216 colors of the 6x6 color cube"
END
! end main program
SUB plot(kk,ii,jj,col)
LET dij=60/51
LET zzi=ii/(51)
LET zzj=jj/(51)
LET xi=zzi*10+kk*dij+100
LET yj=zzj*10+100
SET COLOR (col)
BOX AREA xi,xi+9,yj,yj+9
END SUB

!iterated color table, dumb, a lot of unneccessary grind
SUB coltableA(ci)
FOR ci = 1 TO 101 STEP 10
LET cj=(ci-1)/100
SET COLOR MIX(ci)cj,cj,cj
NEXT ci
FOR ci = 2 TO 102 STEP 10
LET cj=(ci-2)/100
SET COLOR MIX(ci)cj,0.5-cj/2,1-cj
!arbitrary/experimental preset color selections
NEXT ci
FOR ci = 3 TO 103 STEP 10
LET cj=(ci-3)/100
SET COLOR MIX(ci)1-cj,cj,0.5-cj/2
NEXT ci
FOR ci = 4 TO 104 STEP 10
LET cj=(ci-4)/100
SET COLOR MIX(ci)0.5-cj/2,1-cj,cj
NEXT ci
FOR ci = 5 TO 105 STEP 10
LET cj=(ci-5)/100
SET COLOR MIX(ci)cj,1-cj/2,1-cj/2
NEXT ci
FOR ci = 6 TO 106 STEP 10
LET cj=(ci-6)/100
SET COLOR MIX(ci)1-cj/2,1-cj/2,cj
NEXT ci
FOR ci = 7 TO 107 STEP 10
LET cj=(ci-7)/100
SET COLOR MIX(ci)1-cj/2,cj,1-cj/2
NEXT ci
FOR ci=8 TO 108 STEP 10
LET cj=(ci-8)/100
SET COLOR MIX(ci)1-cj/2,0.5-cj/2,cj
NEXT ci
FOR ci = 9 TO 109 STEP 10
LET cj=(ci-9)/100
SET COLOR MIX(ci)1-cj/2,cj,0.5-cj/2
NEXT ci
FOR ci=10 TO 110 STEP 10
LET cj=(ci-10)/100
SET COLOR MIX(ci)0.5-cj/2,cj,1-cj/2
NEXT ci
END SUB

SUB coltableSinA(mc,p,q,r,s,t,u)
LET a=sin(p*mc*PI/s)
LET b=sin(q*mc*PI/t)
LET c=sin(r*mc*PI/u)
SET COLOR MIX (colC)1-a,1-b,1-c
SET COLOR colC
END SUB


Website, Text and Some Images Copyright © 2002 tzingaro.com, all rights reserved.