pyvista.Color.float_rgba

Contents

pyvista.Color.float_rgba#

property Color.float_rgba: tuple[float, float, float, float][source]#

Get the color value as an RGBA float tuple.

Examples

Create a blue color with custom opacity.

>>> import pyvista as pv
>>> c = pv.Color('blue', opacity=0.6)
>>> c
Color(name='blue', hex='#0000ff99', opacity=153)
>>> c.float_rgba
(0.0, 0.0, 1.0, 0.6)

Create a transparent red color using a float RGBA sequence.

>>> c = pv.Color([1.0, 0.0, 0.0, 0.2])
>>> c
Color(name='red', hex='#ff000033', opacity=51)
>>> c.float_rgba
(1.0, 0.0, 0.0, 0.2)