Hey AlSchemist,
I have tested your Script and have found an Error which leads me to another Error.
> (define (adapt color1 color2 ratio)
(if (null? color1)
'()
(cons (+(* (car color1) ratio) (* (car color2) (- 1 ratio)))
(adapt (cdr color1) (cdr color2) ratio)
) ) )
adapt
> (adapt '(12 12 12) '(1 1 1) 0.4)
(5,4.0 5,4.0 5,4.0)
> (adapt '(12 12 12) '(12 12 12) 0.4)
(12.0 12.0 12.0)
> (adapt '(12 12 12) '(6 6 6) 0.4)
(8,4.0 8,4.0 8,4.0)
I hope you can see that I must changed the Second Color1 to Color2.
This is in Because I need the Mixing between Color1 and Color2.
Then I have get another Error, When I give the Subroutine equal Lists all working.
But when I try to mix different Lists I got duplicated Values near the Right Result but computational Wrong.
So I now have tried to address Results which are Integer-Lists,
> (adapt '(12 12 12) '(6 6 6) 0.5)
(9.0 9.0 9.0)
> (adapt '(12 12 12) '(0 0 0) 0.5)
(6.0 6.0 6.0)
> (adapt '(12 12 12) '(0 0 0) 0.75)
(9.0 9.0 9.0)
then It works perfectly
I think that I have understand the Mathematical Background, and them seams correct
but can Anybody find the Problem.