how can i Repeating the pattern for the rest respectively

187
1
10-11-2019 01:04 AM
maziyaryousefi
New Contributor II

hi everyone .I want to repeat the pattern of the colored part of this design respectively for the rest . how this can be done .very thanks

Lot -->
split(z) { ~3 : Tile(split.index) }*


Tile(n) -->
case n ==0 :
color(1,0,0)

case n ==1 :
color(1,1,0)

case n ==2 :
color(1,0,1)

else :
Remainder

0 Kudos
1 Reply
CherylLau
Esri Regular Contributor

This will fill in the colors in the order red, yellow, magenta until no tiles are left.

Lot -->
	split(z) { ~3: Tile(split.index) }*

Tile(ind) -->
	case ind%3==0:
		color(1,0,0)
	case ind%3==1:
		color(1,1,0)
	else:
		color(1,0,1)

If you want to make sure that the colors always appear in a group of three (i.e. you always end on magenta), you can use nested splits.

Lot2 -->
	split(x) { ~9: ThreeTiles }*
	
ThreeTiles -->
	split(x) { ~1: color(1,0,0) Red.
			 | ~1: color(1,1,0) Yellow.
			 | ~1: color(1,0,1) Magenta. }
0 Kudos