gradient_cache_repeat_ref.yaml (2962B)
1 --- 2 root: 3 items: 4 # non-repeating 5 - type: gradient 6 bounds: 100 50 500 10 7 start: 100 0 8 end: 200 0.001 9 repeat: false 10 stops: [0.0, green, 11 0.5, green, 12 0.5, blue, 13 1.0, blue ] 14 15 # repeat 4 times 16 - type: gradient 17 bounds: 100 100 500 10 18 start: 100 0 19 end: 200 0.001 20 repeat: true 21 stops: [0.0, green, 22 0.5, green, 23 0.5, blue, 24 1.0, blue ] 25 26 # same but start doesn't line up with 0 27 - type: gradient 28 bounds: 100 150 500 10 29 start: 125 0 30 end: 225 0.001 31 repeat: true 32 stops: [0.0, green, 33 0.5, green, 34 0.5, blue, 35 1.0, blue ] 36 37 # more hard stops, non-uniform distribution 38 - type: gradient 39 bounds: 100 250 500 10 40 start: 200 0 41 end: 300 0.001 42 repeat: false 43 stops: [0.0, green, 44 0.25, green, 45 0.25, red, 46 0.75, red, 47 0.75, blue, 48 1.0, blue ] 49 50 # repeat the hard stops 51 - type: gradient 52 bounds: 100 300 500 10 53 start: 200 0 54 end: 300 0.001 55 repeat: true 56 stops: [0.0, green, 57 0.25, green, 58 0.25, red, 59 0.75, red, 60 0.75, blue, 61 1.0, blue ] 62 63 # same but start doesn't line up with 0 64 - type: gradient 65 bounds: 100 350 500 10 66 start: 175 0 67 end: 275 0.001 68 repeat: true 69 stops: [0.0, green, 70 0.25, green, 71 0.25, red, 72 0.75, red, 73 0.75, blue, 74 1.0, blue ] 75 76 # the entire gradient from 0 to 1 is 77 # "offscreen", we're only seeing its 78 # repeats. the gradient is 100 wide 79 # and ends at -75, so the first 80 # three-quarters of it would be hidden, 81 # that is, it should start with blue. 82 - type: gradient 83 bounds: 100 400 500 10 84 start: -175 0 85 end: -75 0.001 86 repeat: true 87 stops: [0.0, green, 88 0.25, green, 89 0.25, red, 90 0.75, red, 91 0.75, blue, 92 1.0, blue ] 93 94 # same but over on the right 95 - type: gradient 96 bounds: 100 450 500 10 97 start: 575 0 98 end: 675 0.001 99 repeat: true 100 stops: [0.0, green, 101 0.25, green, 102 0.25, red, 103 0.75, red, 104 0.75, blue, 105 1.0, blue ] 106 107 # a repeat, but not really because only part 108 # of the gradient is visible 109 - type: gradient 110 bounds: 100 500 500 10 111 start: -50 0 112 end: 550 0.001 113 repeat: true 114 stops: [0.0, green, 115 0.25, green, 116 0.25, red, 117 0.75, red, 118 0.75, blue, 119 1.0, blue ]