ColorRGBA
Red, green, blue and alpha, each a float in 0..1 (alpha 1 is opaque).
Full docstring
`from_hex` / `to_hex` read and write ``#rrggbb`` and ``#rrggbbaa`` (8 bits a channel). std_msgs/ColorRGBA is float32, so a ROS round trip keeps 8-bit colours exactly but not arbitrary float64 values.
Preview
The figure robot_msgs.viz.plot(example) draws for the example below.

Fields
| Name | Type | Default |
|---|---|---|
r | float | 0.0 |
g | float | 0.0 |
b | float | 0.0 |
a | float | 1.0 |
Example
One instance from the package's own test catalog; the output is its real repr().
ColorRGBA(r=0.5, g=0.25, b=0.75, a=1.0)to_dict() as JSON
{
"_type": "std/ColorRGBA",
"r": 0.5,
"g": 0.25,
"b": 0.75,
"a": 1.0
}Long arrays are cut after 16 values and say so with “…”.
Functions
Constructors
Classmethods and staticmethods: ways to build one.
from_hex(text: str) -> ColorRGBA#rrggbb, #rrggbbaa or the CSS shorthand #rgb; the # is optional.
Related types
No other type refers to it, and it refers to none.