Thanks for your help! Sadly, it still took me another 20 minutes to get what you were describing working - the important point I needed to get was that "hue x|" is specified in degrees, whereas "|hue x" is a percentage out of 1 (not 100 - oops). Really took me a bit to wrap my head around that.
Below are my working tests so that others who find this thread can learn by example.
Incidentally, I uncover what might be a bug - using [] to specify the transform order has no effect on whether the target value is changed before or after the target-step. That is, the expected behavior of [r 45 x 1] and [x 1 r 45] is very different, but there is no difference between the behavior of [|hue .5 hue 10|] and [hue 10| |hue .5].
In the meantime, the important thing to know is that the target always shifts second.
Code: Select all
startshape targettest
include i_pix.cfdg
background { b -1 }
rule targettest { examples { b 1 sat 1 |h 90} } // all examples have a target of 60
rule examples { base { x 1 } example1 { x 2 } example2 { x 3 } example3 { x 4 } compare { x 3.5 y -.75 z -1 s .4 } }
rule base { CIRCLE {} base { s .75 y -.75 h 30 } } // hue 0, 30, 60, 90, 120...
rule example1 { CIRCLE {} label1 {} example1 { y -.75 h .5| s .75 } }
// hue approaches target by 50% each step:
// 0 + 90/2 = 45 T 90
// 45 + 45/2 = 67.5 T 90
// 67.5 + 22.5/2 = 78.75 T 90 etc.
rule example2 { CIRCLE {} label2 {} example2 [ y -.75 h .5| |h 10 s .75 ] }
// hue approaches moving target:
// 0 + 90/2 = 45 T 90
// 45 + 50/2 = 70 T 100 etc.
rule example3 { CIRCLE {} label3 {} example3 [ y -.75 |h 10 h .5| s .75 ] }
// hue approaches moving target (doesn't work differently from above, should?):
// should be:
// 0 + 100/2 = 50 T 100
// 50 + 55/2 = 77.5 T 110 etc.
rule label1 { NUM_1_5by5 { b -1 s .2 } }
rule label2 { NUM_2_5by5 { b -1 s .2 } }
rule label3 { X_5by5 { b -1 s .2 } }
rule compare { CIRCLE { h 50 } }