Skip to content

Color Quantities

Visualize color rgb-valued data at the points of a point cloud.

Example:

import numpy as np
import polyscope as ps
ps.init()

# register a point cloud
N = 100
points = np.random.rand(N, 3)
ps_cloud = ps.register_point_cloud("my points", points, enabled=True)

# generate some random color per-point
vals = np.random.rand(N,3)

# basic color visualization
ps_cloud.add_color_quantity("rand colors", vals)

ps.show() 

PointCloud.add_color_quantity(name, values, enabled=None)

Add a color quantity to the point cloud.

  • name string, a name for the quantity
  • values an Nx3 numpy array, with rgb [0,1] colors at points

This function also accepts optional keyword arguments listed below, which customize the appearance and behavior of the quantity.

Color Quantity Options

When adding a color quantity, the following keyword options can be set. These are available for all kinds of color quantities on all structures.

Keyword arguments:

  • enabled boolean, whether the quantity is initially enabled (note that generally only one quantitiy can be shown at a time; the most recent will be used)

If not specified, these optional parameters will assume a reasonable default value, or a persistent value if previously set.