Ghpython Assign colors to tree branches

Hello
how to assign different n colors to n branches?

color tree.gh (15.0 KB)

a = []
b = []

#if y have tree access
#for i in range(y.BranchCount):
#branchList = y.Branch(i)
#for j,k in enumerate(branchList):
    #b.append(k)
    #print k

for i in range(x.BranchCount):
branchList = x.Branch(i)
branchPath = x.Path(i)

for j in range(branchList.Count):
    s = str(branchPath) + "[" + str(j) + "] "
    #s += type(branchList[j]).__name__ + ": "
    #s += str(branchList[j])
    s += y[j]
    c = y[j]
    
    a.append(s)
    b.append(c)
1 Like