graphics ! graphics clear 1,1,1
get screen size w,h ! cx=w/2 ! cy=h/2
'
t=20 ' thickness of the fabric
dhue=6 ' speed of color change
'
hue=rnd(360)
draw size t ! dtet=0.01
R=5 ! x=cx ! y=cy ! draw to cx,cy
for tet=0 to 2300/t step dtet
R=5+tet*t/6.2
hue+=rnd(dhue)-dhue/2 ! if hue<0 then hue+=360
pal(hue) ! draw color pal.r,pal.g,pal.b
x=cx+R*cos(tet) ! y=cy+R*sin(tet)
draw line to x,y
next tet
end
' Simple color definition function, based on HSV system
' only HUE factor (h) is required (-> restricted color range)
'
def pal(h)
r=0 ! g=0 ! b=0 ! h%=360
if h<120 or h>240 then r=palsub(abs(h-360*floor(h/240)))
if h<240 then g=palsub(abs(h-120))
if h>120 then b=palsub(abs(h-240))
end def
def palsub(e)
f=.7 ' 0<=f<=1 better balance between prim. and sec. colors
if e<60 then c=1 else ! x=(120-e)/60 ! c=x*(1+f-f*x) ! end if
return c
end def
When I met my then future ex wife #2 in New Jersey, she was the VP at a textile dye plant that did what you are asking for, but they did not use computers.
I can ask her to see if she is willing to call them and see if they use computers to desgin and print patterns with colors on fabrics, including rugs.
The old way they needed to run the fabric multiple times for each color. But we're talking 1980's and possibly earlier technology.
These are great! Now I just need to know who can print one onto an actual rug.
George McGinn
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)