Property.color#
- property Property.color: Color[source]#
Return or set the color of this property.
Either a string, RGB list, or hex color string. For example:
color='white',color='w',color=[1.0, 1.0, 1.0], orcolor='#FFFFFF'. Color will be overridden if scalars are specified.
Examples#
Download Python source code | Download Jupyter notebook
Get the default color and visualize it.
>>> import pyvista as pv
>>> prop = pv.Property()
>>> prop.color
Color(name='light_blue', hex='#add8e6ff', opacity=255)
>>> prop.plot()
Visualize a red color.
>>> prop.color = 'red'
>>> prop.plot()
Visualize an RGB color.
>>> prop.color = (0.5, 0.5, 0.1)
>>> prop.plot()