to_rgba¶
-
to_rgba
(color, space='rgb', cycle=None)[source]¶ Translate the color in any format and from any colorspace to an RGB tuple. This is a generalization of
matplotlib.colors.to_rgba
and the inverse ofto_xyza
.- Parameters
color (str, 3-tuple, or 4-tuple) – The color specification. Can be a tuple of channel values, a hex string, a registered color name, a cycle color like
'C0'
, or a colormap color (seeColorDatabase
).If
space
is'rgb'
, this is a tuple of RGB values, and if any channels are larger than2
, the channels are assumed to be on the0
to255
scale and are divided by255
.space ({‘rgb’, ‘hsv’, ‘hcl’, ‘hpl’, ‘hsl’}, optional) – The colorspace for the input channel values. Ignored unless
color
is a tuple of numbers.cycle (str or list, optional) – The registered color cycle name used to interpret colors that look like
'C0'
,'C1'
, etc. Default isrc.cycle
='colorblind'
.
- Returns
color (4-tuple) – An RGBA tuple.