# Examples from pyvista.CompositePolyDataMapper.set_unique_colors
# ===============================================================

# Set each block of the composite dataset to a unique color.
import pyvista as pv
dataset = pv.MultiBlock([pv.Cube(), pv.Sphere(center=(0, 0, 1))])
pl = pv.Plotter()
actor, mapper = pl.add_composite(dataset)
mapper.set_unique_colors()
mapper.block_attr[1].color
mapper.block_attr[2].color

pl.show()

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code

